Skip to content

Commit

Permalink
chore reworking updatecli manifest (#139)
Browse files Browse the repository at this point in the history
* chore reworking updatecli manifest

* chore (updatecli) : keep up to date the version of the docker image hashicorp-tools
  • Loading branch information
smerle33 authored Feb 23, 2022
1 parent 3b1d2a4 commit b72e865
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 28 deletions.
4 changes: 3 additions & 1 deletion Jenkinsfile_k8s
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
def dockerImage = 'jenkinsciinfra/hashicorp-tools:0.3.5' // Tracked by updatecli

parallel(
failFast: true,
'Build Easyvpn': {
Expand Down Expand Up @@ -26,6 +28,6 @@ parallel(
}
},
'docker-and-updatecli': {
parallelDockerUpdatecli([imageName: 'openvpn', containerMemory: '1024Mi'])
parallelDockerUpdatecli([imageName: 'openvpn', updatecliConfig: [containerMemory: '1024Mi', updatecliDockerImage: dockerImage]])
},
)
44 changes: 17 additions & 27 deletions updatecli/updatecli.d/golang.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
---
title: "Bump golang 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:
latestGoVersion:
kind: githubRelease
Expand Down Expand Up @@ -28,15 +41,7 @@ targets:
kind: file
spec:
file: ./utils/easyvpn/go.mod
scm:
github:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
branch: "{{ .github.branch }}"
scmID: default
updateMakefile:
name: "Update the golang docker image version in the Makefile for easyvpn"
sourceID: latestGoVersion
Expand All @@ -45,15 +50,7 @@ targets:
file: ./utils/easyvpn/Makefile
matchPattern: 'GOLANG_VERSION \?= .*'
replacePattern: 'GOLANG_VERSION ?= {{ source `latestGoVersion` }}'
scm:
github:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
branch: "{{ .github.branch }}"
scmID: default
updateJenkinsfile:
name: "Update the golang docker image version for the Jenkinsfile pod container agent"
sourceID: latestGoVersion
Expand All @@ -64,12 +61,5 @@ targets:
'golang:.*'
replacePattern: >-
'golang:{{ source `latestGoVersion` }}'
scm:
github:
user: "{{ .github.user }}"
email: "{{ .github.email }}"
owner: "{{ .github.owner }}"
repository: "{{ .github.repository }}"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
branch: "{{ .github.branch }}"
scmID: default

53 changes: 53 additions & 0 deletions updatecli/updatecli.d/hashicorp-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
title: Bump `hashicorp-tools` docker image version from lastest image release

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:
dockerHashicorpToolsImageVersion:
kind: githubRelease
spec:
owner: "jenkins-infra"
repository: "docker-hashicorp-tools"
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"

conditions:
checkIfDockerImageIsPublished:
name: "Check if the Docker Image is published"
kind: dockerImage
spec:
image: "jenkinsciinfra/hashicorp-tools"
architecture: amd64

targets:
updateJenkinsFile:
name: Update Jenkinsfile in groovy code
kind: file
spec:
file: ./Jenkinsfile_k8s
# Please note that the patterns are specified as "block scalars" (>) - https://yaml-multiline.info/ - with the last endline trimmed (-) to avoid tedious escaping of simple quotes
matchpattern: >-
'jenkinsciinfra/hashicorp-tools:(.*)'
replacepattern: >-
'jenkinsciinfra/hashicorp-tools:{{ source `dockerHashicorpToolsImageVersion` }}'
scmID: default

pullrequests:
default:
kind: github
scmID: default
targets:
- updateJenkinsFile
spec:
labels:
- dependencies

0 comments on commit b72e865

Please sign in to comment.