-
Notifications
You must be signed in to change notification settings - Fork 55
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
Automate updating weekly version #689
Merged
timja
merged 5 commits into
jenkinsci:master
from
timja:automate-updating-weekly-version
Oct 21, 2021
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9946bf9
Automate updating weekly version
timja 550c43f
Downgrade weekly for testing on CI
timja 3adc568
Update updatecli/updatecli.d/weekly-apply.sh
timja 8282cbb
Update .github/workflows/updatecli.yaml
timja 7bd8bdf
Review feedback
timja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: updatecli | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
# Run once a day | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
updatecli: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Apply | ||
uses: updatecli/updatecli-action@v1 | ||
with: | ||
flags: "--config updatecli/updatecli.d --values updatecli/values.yaml" | ||
env: | ||
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
timja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
set -eux -o pipefail | ||
|
||
# Script "weekly-apply.sh" | ||
# The script checks the current weekly version in the sample plugin | ||
# - if different than $1 and DRY_RUN is set to: | ||
# - "false" then it updates it with the value of $1 | ||
# - "true" then it only reports the value of $1 | ||
# - otherwise it exits without any value reported | ||
existing_version=$(mvn help:evaluate -f sample-plugin -Dexpression=jenkins.version -q -DforceStdout) | ||
timja marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if test "$1" == "$(echo "${existing_version}")" | ||
then | ||
## No change | ||
# early return with no output | ||
exit 0 | ||
else | ||
if test "$DRY_RUN" == "false" | ||
then | ||
## Value changed to $1" - NO dry run | ||
mvn versions:set-property -DgenerateBackupPoms=false -Dproperty=jenkins.version -DnewVersion="$1" | ||
fi | ||
# Report on stdout | ||
echo "$1" | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
sources: | ||
newVersion: | ||
name: Get Jenkins Version | ||
kind: maven | ||
spec: | ||
owner: "maven" | ||
url: "repo.jenkins-ci.org" | ||
repository: "releases" | ||
groupID: "org.jenkins-ci.main" | ||
artifactID: "jenkins-war" | ||
|
||
targets: | ||
default: | ||
name: setWeeklyVersion | ||
sourceID: newVersion | ||
kind: shell | ||
spec: | ||
command: bash ./updatecli/updatecli.d/weekly-apply.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
github: | ||
user: "GitHub Actions" | ||
email: "41898282+github-actions[bot]@users.noreply.github.com" | ||
username: "github-actions" | ||
token: "UPDATECLI_GITHUB_TOKEN" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? Just to see if the workflow will bump it back up again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes