forked from elastic/integrations
-
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.
Add github action to bump stack versions (elastic#10599)
The action uses updatecli to automate bump of stack snapshots used for testing.
- Loading branch information
Showing
5 changed files
with
150 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
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,50 @@ | ||
--- | ||
name: Update versions of Elastic Stack dependencies | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 1 * * 1-5' | ||
pull_request: | ||
paths: | ||
- .github/updatecli.d/* | ||
- .github/workflows/bump-elastic-stack-version.yml | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
bump-elastic-stack: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Updatecli in the runner | ||
uses: updatecli/[email protected] # updatecli v0.80.0 | ||
|
||
- name: Select diff action | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: | | ||
echo "UPDATECLI_ACTION=diff" >> $GITHUB_ENV | ||
- name: Select apply action | ||
if: ${{ github.event_name != 'pull_request' }} | ||
run: | | ||
echo "UPDATECLI_ACTION=apply" >> $GITHUB_ENV | ||
- name: Update latest testing 7.x stack version | ||
# --experimental needed for commitusingapi option. | ||
run: updatecli --experimental ${{ env.UPDATECLI_ACTION }} --config .github/workflows/updatecli.d/bump-latest-7x-version.yml --values .github/workflows/updatecli.d/scm.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Update latest testing stack version | ||
# --experimental needed for commitusingapi option. | ||
run: updatecli --experimental ${{ env.UPDATECLI_ACTION }} --config .github/workflows/updatecli.d/bump-latest-snapshot-version.yml --values .github/workflows/updatecli.d/scm.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,43 @@ | ||
--- | ||
name: Bump 7.x test version | ||
pipelineid: 'bump-elastic-stack-7x-version' | ||
|
||
actions: | ||
default: | ||
title: '[updatecli] Update 7.x snapshot to {{ source "latest7xSnapshot" }}' | ||
kind: github/pullrequest | ||
scmid: default | ||
spec: | ||
labels: | ||
- automation | ||
- dependency | ||
|
||
scms: | ||
default: | ||
kind: github | ||
spec: | ||
owner: '{{ .scm.owner }}' | ||
repository: '{{ .scm.repository }}' | ||
user: '{{ requiredEnv "GITHUB_ACTOR" }}' | ||
token: '{{ requiredEnv "GITHUB_TOKEN" }}' | ||
commitusingapi: true | ||
branch: main | ||
|
||
sources: | ||
latest7xSnapshot: | ||
name: Get latest 7.x snapshot | ||
kind: json | ||
spec: | ||
file: https://storage.googleapis.com/artifacts-api/snapshots/7.17.json | ||
key: .version | ||
|
||
targets: | ||
update-7x-version: | ||
name: '[updatecli] Update 7.x snapshot to {{ source "latest7xSnapshot" }}' | ||
kind: file | ||
sourceid: latest7xSnapshot | ||
scmid: default | ||
spec: | ||
file: '.buildkite/pipeline.schedule-daily.yml' | ||
matchpattern: '(STACK_VERSION:) 7\.[^\s]*\.[^\s]*' | ||
replacepattern: '$1 {{ source "latest7xSnapshot" }}' |
43 changes: 43 additions & 0 deletions
43
.github/workflows/updatecli.d/bump-latest-snapshot-version.yml
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,43 @@ | ||
--- | ||
name: Bump latest elastic-stack test version | ||
pipelineid: 'bump-latest-elastic-stack-version' | ||
|
||
actions: | ||
default: | ||
title: '[updatecli] Update latest snapshot to {{ source "latestSnapshot" }}' | ||
kind: github/pullrequest | ||
scmid: default | ||
spec: | ||
labels: | ||
- automation | ||
- dependency | ||
|
||
scms: | ||
default: | ||
kind: github | ||
spec: | ||
owner: '{{ .scm.owner }}' | ||
repository: '{{ .scm.repository }}' | ||
user: '{{ requiredEnv "GITHUB_ACTOR" }}' | ||
token: '{{ requiredEnv "GITHUB_TOKEN" }}' | ||
commitusingapi: true | ||
branch: main | ||
|
||
sources: | ||
latestSnapshot: | ||
name: Get latest snapshot | ||
kind: json | ||
spec: | ||
file: https://storage.googleapis.com/artifacts-api/snapshots/main.json | ||
key: .version | ||
|
||
targets: | ||
update-snapshot: | ||
name: '[updatecli] Update latest snapshot to {{ source "latestSnapshot" }}' | ||
kind: file | ||
sourceid: latestSnapshot | ||
scmid: default | ||
spec: | ||
file: '.buildkite/pipeline.schedule-daily.yml' | ||
matchpattern: '(STACK_VERSION:) 8\.[^\s]*\.[^\s]*' | ||
replacepattern: '$1 {{ source "latestSnapshot" }}' |
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,4 @@ | ||
--- | ||
scm: | ||
owner: elastic | ||
repository: integrations |