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

Add sample to use updatecli to update mysql image #10652

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/bump-integration-services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Update versions of integrations services.

on:
workflow_dispatch:
schedule:
- cron: '0 1 * * 1-5'
pull_request:
paths:
- .github/updatecli-packages.d/*
- .github/workflows/bump-integration-services.yml

permissions:
contents: read

jobs:
bump-mysql-version:
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]

- 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 mysql services.
# --experimental needed for commitusingapi option.
run: updatecli --experimental ${{ env.UPDATECLI_ACTION }} --config .github/workflows/updatecli-packages.d/mysql.yml --values .github/workflows/updatecli.d/scm.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Comment on lines +40 to +44
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following this approach, an entry like this one would be needed for any service. We could try to find some way to run all the configs at once.

42 changes: 42 additions & 0 deletions .github/workflows/updatecli-packages.d/mysql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Bump latest mysql service test version
pipelineid: 'bump-latest-mysql-variant-version'

actions:
default:
title: '[updatecli] Update latest mysql version to {{ source "latest" }}'
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:
latest:
kind: dockerimage
spec:
image: mysql
architecture: "linux/amd64"
kind: latest
tagfilter: '^8.\d*.\d*$'

targets:
mysqlTag:
name: "mysql variant"
kind: file
spec:
file: "packages/mysql/_dev/deploy/variants.yml"
matchpattern: '(IMAGE: mysql:)8.*'
replacepattern: '${1}{{ source "latest" }}'
Comment on lines +26 to +42
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This source and target would be the main part to configure for every version to upgrade.

4 changes: 2 additions & 2 deletions packages/mysql/_dev/deploy/variants.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variants:
mysql_8_0_35:
mysql_8:
IMAGE: mysql:8.0.35
percona_8_0_36:
IMAGE: percona:8.0.34-26
default: mysql_8_0_35
default: mysql_8