Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limit sed replacement to line 17 #749

Merged
merged 5 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/updatecli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- name: Install updatecli # Until https://github.com/updatecli/updatecli/pull/336
run: |
curl -sSL https://github.com/updatecli/updatecli/releases/download/v0.14.0/updatecli_Linux_x86_64.tar.gz -o updatecli.tgz
curl -sSL https://github.com/updatecli/updatecli/releases/download/v0.16.1/updatecli_Linux_x86_64.tar.gz -o updatecli.tgz
tar xzf updatecli.tgz -C /usr/local/bin
updatecli version
rm -f updatecli.tgz
Expand Down
6 changes: 3 additions & 3 deletions updatecli/updatecli.d/weekly-apply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ set -eux -o pipefail
# - otherwise it exits without any value reported

# if the parent pom is already built no need to rebuild the whole project (faster build time)
existing_version=$(awk -F "[><]" '/jenkins.version/{print $3;exit}' ./sample-plugin/pom.xml)
existing_version=$(awk -F "[><]" 'NR == 17 && /jenkins.version/{print $3}' ./sample-plugin/pom.xml)

if test "$1" == "$(echo "${existing_version}")"
if test "$1" == "${existing_version}"
then
## No change
# early return with no output
Expand All @@ -21,7 +21,7 @@ else
if test "$DRY_RUN" == "false"
then
## Value changed to $1" - NO dry run
sed -i -e "s#<jenkins.version>[0-9]\+.[0-9]\+</jenkins.version>#<jenkins.version>$1</jenkins.version>#" ./sample-plugin/pom.xml
sed -i -e "17s#<jenkins.version>[0-9.]\+</jenkins.version>#<jenkins.version>$1</jenkins.version>#" ./sample-plugin/pom.xml
fi
# Report on stdout
echo "$1"
Expand Down