From 233dc09593da65bb0a135eda89ccd852944e94ed Mon Sep 17 00:00:00 2001 From: Dann Bohn Date: Wed, 13 Jan 2021 16:10:09 -0500 Subject: [PATCH] adds appVersion to equal circle tag if it exists --- bin/pr-release | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/pr-release b/bin/pr-release index f97bb0c..bcc2444 100755 --- a/bin/pr-release +++ b/bin/pr-release @@ -8,13 +8,17 @@ git remote set-url origin "http://${GITHUB_USER}:${GITHUB_TOKEN}@$project" git config --global user.email "${GITHUB_USER}@psu.edu" git config --global user.name "${GITHUB_USER}" - filename=$1 git checkout -b $CIRCLE_PROJECT_REPONAME-$CIRCLE_TAG sed -i -e 's/^\([[:space:]]*\)values: |/\1values:/g' $filename yq w "$filename" spec.source.helm.values.image.tag $CIRCLE_TAG -i sed -i -e 's/[[:space:]]values:/ values: |/g' "$filename" +if [[ ! $(yq read $filename metadata.annotations.appVersion) == "null" ]]; then + echo "adding appVersion" + yq w "$filename" metadata.annotations.appVersion $CIRCLE_TAG -i +fi + git add $filename git commit -m "release $CIRCLE_TAG for $CIRCLE_PROJECT_REPONAME" git push -u origin $CIRCLE_PROJECT_REPONAME-$CIRCLE_TAG