Skip to content

Commit

Permalink
Merge pull request #6 from psu-libraries/yq4
Browse files Browse the repository at this point in the history
yq4 syntax for pr release script
  • Loading branch information
whereismyjetpack authored Aug 23, 2023
2 parents 8d5d9a3 + d88e2ec commit 3ec367e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions bin/pr-release
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@ 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

yq -i ".spec.source.helm.valuesObject.image.tag=\"$CIRCLE_TAG\"" "$filename"

git add $filename
git commit -m "release $CIRCLE_TAG for $CIRCLE_PROJECT_REPONAME"
Expand Down

0 comments on commit 3ec367e

Please sign in to comment.