forked from spring-projects/spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
1 deletion.
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
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,28 @@ | ||
#!/bin/bash | ||
|
||
ISSUE_TITLE="Upgrade Ubuntu version in CI images" | ||
|
||
ubuntu="bionic" | ||
latest=$( curl -s "https://partner-images.canonical.com/core/$ubuntu/current/unpacked/build-info.txt" | awk '{split($0, parts, "="); print parts[2]}' ) | ||
current=$( grep "ubuntu:$ubuntu" git-repo/ci/images/spring-boot-ci-image/Dockerfile | awk '{split($0, parts, "-"); print parts[2]}' ) | ||
|
||
if [[ $current = $latest ]]; then | ||
echo "Already up-to-date" | ||
exit 0; | ||
fi | ||
|
||
existing_tasks=$( curl -s https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/issues\?labels\=type:%20task\&state\=open\&creator\=spring-buildmaster ) | ||
existing_upgrade_issues=$( echo "$existing_tasks" | jq -c --arg TITLE "$ISSUE_TITLE" '.[] | select(.title==$TITLE)' ) | ||
|
||
if [[ ${existing_upgrade_issues} = "" ]]; then | ||
curl \ | ||
-s \ | ||
-u ${GITHUB_USERNAME}:${GITHUB_PASSWORD} \ | ||
-H "Content-type:application/json" \ | ||
-d "{\"title\":\"${ISSUE_TITLE}\",\"body\": \"Upgrade to ubuntu:${ubuntu}-${latest}\",\"labels\":[\"status: waiting-for-triage\",\"type: task\"]}" \ | ||
-f \ | ||
-X \ | ||
POST "https://api.github.com/repos/${GITHUB_ORGANIZATION}/${GITHUB_REPO}/issues" > /dev/null || { echo "Failed to create issue" >&2; exit 1; } | ||
else | ||
echo "Issue already exists." | ||
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,11 @@ | ||
--- | ||
platform: linux | ||
inputs: | ||
- name: git-repo | ||
params: | ||
GITHUB_REPO: | ||
GITHUB_ORGANIZATION: | ||
GITHUB_PASSWORD: | ||
GITHUB_USERNAME: | ||
run: | ||
path: git-repo/ci/scripts/detect-ubuntu-image-updates.sh |