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

chore(alpine): Tracks alpine linux base version #1654

Merged
merged 6 commits into from
Jun 19, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/updatecli.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: updatecli
on:
# Allow to be run manually
workflow_dispatch:
schedule:
# Run once per week (to avoid alert fatigue)
- cron: '0 2 * * 1' # Every Monday at 2am UTC
push:
pull_request:
jobs:
updatecli:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Updatecli in the runner
uses: updatecli/updatecli-action@v2.30.0

- name: Run Updatecli in Dry Run mode
run: updatecli diff --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml
env:
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Updatecli in Apply mode
if: github.ref == 'refs/heads/master'
run: updatecli apply --config ./updatecli/updatecli.d --values ./updatecli/values.github-action.yaml
env:
UPDATECLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102 changes: 102 additions & 0 deletions updatecli/updatecli.d/alpine.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
name: Bump Alpine version

scms:
default:
kind: github
spec:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
branch: "{{ .github.branch }}"

sources:
latestVersion:
kind: githubrelease
name: "Get the latest Alpine Linux version"
spec:
owner: "alpinelinux"
repository: "aports" # Its release process follows Alpine's
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
versionfilter:
kind: semver
pattern: "~3"
transformers:
- trimprefix: "v"

conditions:
testDockerfileArgJDK11:
name: "Does the Dockerfile have an ARG instruction for the Alpine Linux version?"
kind: dockerfile
disablesourceinput: true
spec:
file: 11/alpine/hotspot/Dockerfile
instruction:
keyword: "ARG"
matcher: "ALPINE_TAG"
testDockerfileArgJDK17:
name: "Does the Dockerfile have an ARG instruction for the Alpine Linux version?"
kind: dockerfile
disablesourceinput: true
spec:
file: 11/alpine/hotspot/Dockerfile
instruction:
keyword: "ARG"
matcher: "ALPINE_TAG"
testDockerImageExists:
name: "Does the Docker Image exist on the Docker Hub?"
kind: dockerimage
sourceid: latestVersion
spec:
image: "alpine"
# tag come from the source
architecture: amd64
testVersionInBakeFile:
name: "Does the bake file have variable ALPINE_VERSION"
kind: file
disablesourceinput: true
spec:
file: docker-bake.hcl
matchpattern: "(.*ALPINE_FULL_TAG.*)"

targets:
updateDockerfileJDK11:
name: "Update the value of the base image (ARG ALPINE_TAG) in the Dockerfile"
kind: dockerfile
spec:
file: 11/alpine/hotspot/Dockerfile
instruction:
keyword: "ARG"
matcher: "ALPINE_TAG"
scmid: default
updateDockerfileJDK17:
name: "Update the value of the base image (ARG ALPINE_TAG) in the Dockerfile"
kind: dockerfile
spec:
file: 17/alpine/hotspot/Dockerfile
instruction:
keyword: "ARG"
matcher: "ALPINE_TAG"
scmid: default
updateDockerBake:
name: "Update the value of the base image (ARG ALPINE_TAG) in the docker-bake.hcl"
kind: file
spec:
file: docker-bake.hcl
matchpattern: >-
variable(.*)"ALPINE_FULL_TAG"(.*){(.*)(\r\n|\r|\n)(.*)default(.*)=(.*)
replacepattern: >-
variable${1}"ALPINE_FULL_TAG"${2}{${3}${4}${5}default${6}= "{{ source "latestVersion" }}"
scmid: default
actions:
default:
kind: github/pullrequest
scmid: default
title: Bump Alpine Linux Version to {{ source "latestVersion" }}
spec:
labels:
- dependencies
8 changes: 8 additions & 0 deletions updatecli/values.github-action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
github:
user: "GitHub Actions"
email: "41898282+github-actions[bot]@users.noreply.github.com"
username: "github-actions"
token: "UPDATECLI_GITHUB_TOKEN"
branch: "master"
owner: "jenkinsci"
repository: "docker"