-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #251 from gounthar/track-alpine-linux-base-version
chore(alpine): Tracks alpine linux base version
- Loading branch information
Showing
1 changed file
with
84 additions
and
0 deletions.
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,84 @@ | ||
--- | ||
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: | ||
testDockerfileArg: | ||
name: "Does the Dockerfile have an ARG instruction for the Alpine Linux version?" | ||
kind: dockerfile | ||
disablesourceinput: true | ||
spec: | ||
file: alpine/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: | ||
updateDockerfile: | ||
name: "Update the value of the base image (ARG ALPINE_TAG) in the Dockerfile" | ||
kind: dockerfile | ||
spec: | ||
file: alpine/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 |