-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updatecli: verify commits for golang and beats (#13107)
(cherry picked from commit 8182fb1) # Conflicts: # .ci/bump-golang.yml # .github/workflows/bump-golang.yml # .github/workflows/update-beats.yml
- Loading branch information
1 parent
5b885bc
commit 4bd431d
Showing
5 changed files
with
142 additions
and
4 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,111 @@ | ||
--- | ||
name: Bump golang-version to latest version | ||
pipelineid: 'updatecli-bump-golang' | ||
|
||
actions: | ||
default: | ||
title: '[updatecli] Bump Golang version to {{ source "latestGoVersion" }}' | ||
kind: github/pullrequest | ||
scmid: default | ||
spec: | ||
labels: | ||
- automation | ||
- backport-skip | ||
- dependencies | ||
description: |- | ||
### What | ||
Bump go release version with the latest release. | ||
### Further details | ||
See [changelog](https://github.com/golang/go/issues?q=milestone%3AGo{{ source "latestGoVersion" }}+label%3ACherryPickApproved) for {{ source "latestGoVersion" }} | ||
scms: | ||
default: | ||
kind: github | ||
spec: | ||
user: '{{ requiredEnv "GITHUB_ACTOR" }}' | ||
owner: elastic | ||
repository: apm-server | ||
token: '{{ requiredEnv "GITHUB_TOKEN" }}' | ||
branch: main | ||
commitusingapi: true | ||
|
||
sources: | ||
minor: | ||
name: Get minor version in .go-version | ||
kind: shell | ||
transformers: | ||
- findsubmatch: | ||
pattern: '^\d+.(\d+).\d+$' | ||
captureindex: 1 | ||
spec: | ||
command: cat .go-version | ||
|
||
latestGoVersion: | ||
name: Get Latest Go Release | ||
kind: githubrelease | ||
dependson: | ||
- minor | ||
transformers: | ||
- trimprefix: go | ||
spec: | ||
owner: golang | ||
repository: go | ||
token: '{{ requiredEnv "GITHUB_TOKEN" }}' | ||
username: '{{ requiredEnv "GIT_USER" }}' | ||
versionfilter: | ||
kind: regex | ||
pattern: go1\.{{ source "minor" }}\.\d*$ | ||
|
||
gomod: | ||
dependson: | ||
- latestGoVersion | ||
name: Get version in go.mod format | ||
kind: shell | ||
transformers: | ||
- findsubmatch: | ||
pattern: '^(\d+.\d+).\d*' | ||
captureindex: 1 | ||
spec: | ||
command: echo {{ source "latestGoVersion" }} | ||
|
||
conditions: | ||
dockerTag: | ||
name: Is docker image golang:{{ source "latestGoVersion" }} published | ||
kind: dockerimage | ||
spec: | ||
image: golang | ||
tag: '{{ source "latestGoVersion" }}' | ||
sourceid: latestGoVersion | ||
|
||
goDefaultVersion-check: | ||
name: Check if defined golang version differs | ||
kind: shell | ||
sourceid: latestGoVersion | ||
spec: | ||
command: 'grep -v -q {{ source "latestGoVersion" }} .go-version #' | ||
|
||
targets: | ||
update-go-version: | ||
name: 'Update .go-version with Golang version {{ source "latestGoVersion" }}' | ||
sourceid: latestGoVersion | ||
scmid: default | ||
kind: file | ||
spec: | ||
content: '{{ source "latestGoVersion" }}' | ||
file: .go-version | ||
matchpattern: '\d+.\d+.\d+' | ||
update-gomod: | ||
name: 'Update go.mod files with {{ source "gomod" }}' | ||
sourceid: gomod | ||
scmid: default | ||
kind: file | ||
spec: | ||
content: 'go {{ source "gomod" }}' | ||
files: | ||
- go.mod | ||
- cmd/intake-receiver/go.mod | ||
- internal/glog/go.mod | ||
- systemtest/go.mod | ||
- tools/go.mod | ||
matchpattern: 'go \d+.\d+' |
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 |
---|---|---|
|
@@ -39,4 +39,3 @@ jobs: | |
command: '--experimental apply' | ||
env: | ||
BRANCH: ${{ matrix.branch }} | ||
GITHUB_ACTOR: ${{ github.actor }} |
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,24 @@ | ||
--- | ||
name: bump-golang | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 20 * * 6' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
bump: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
- uses: elastic/apm-pipeline-library/.github/actions/updatecli@current | ||
with: | ||
vaultUrl: ${{ secrets.VAULT_ADDR }} | ||
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }} | ||
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }} | ||
pipeline: ./.ci/bump-golang.yml | ||
command: '--experimental apply' |
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