Skip to content

Commit 45da429

Browse files
Automate Kolla version updates (#1532)
Automated Kolla dependencies updates
1 parent c2f06cd commit 45da429

File tree

4 files changed

+95
-3
lines changed

4 files changed

+95
-3
lines changed
+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Update dependencies
2+
3+
on:
4+
# Allow manual executions
5+
workflow_dispatch:
6+
# Run nightly
7+
schedule:
8+
- cron: '0 0 * * *'
9+
10+
jobs:
11+
propose_github_release_updates:
12+
runs-on: ubuntu-22.04
13+
strategy:
14+
matrix:
15+
include:
16+
- key: kolla
17+
path: src/kayobe-config/etc/kayobe/stackhpc.yml
18+
repository: stackhpc/kolla
19+
search_regex: 'stackhpc_kolla_source_version\:.*$'
20+
prefix: 'stackhpc_kolla_source_version\: '
21+
22+
- key: kolla-ansible
23+
path: src/kayobe-config/etc/kayobe/stackhpc.yml
24+
repository: stackhpc/kolla-ansible
25+
search_regex: 'stackhpc_kolla_ansible_source_version\:.*$'
26+
prefix: 'stackhpc_kolla_ansible_source_version\: '
27+
28+
- key: kayobe
29+
path: src/kayobe-config/requirements.txt
30+
repository: stackhpc/kayobe
31+
search_regex: 'kayobe@stackhpc\/.*$'
32+
prefix: 'kayobe@'
33+
permissions:
34+
contents: write
35+
pull-requests: write
36+
name: ${{ matrix.key }}
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
with:
41+
path: ${{ github.workspace }}/src/kayobe-config
42+
43+
- name: Determine OpenStack release
44+
id: openstack_release
45+
run: |
46+
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' .gitreview)
47+
echo "openstack_release=${BRANCH}" | sed -E "s,(stable|unmaintained)/,," >> $GITHUB_OUTPUT
48+
working-directory: ${{ github.workspace }}/src/kayobe-config
49+
50+
- name: Checkout the dependency repo
51+
uses: actions/checkout@v4
52+
with:
53+
repository: ${{ matrix.repository }}
54+
ref: stackhpc/${{ steps.openstack_release.outputs.openstack_release }}
55+
fetch-tags: true
56+
path: ${{ github.workspace }}/src/${{ matrix.key }}
57+
58+
- name: Get latest tag
59+
id: latest_tag
60+
run: |
61+
TAG=$(git describe --tags --abbrev=0 --match stackhpc/\*)
62+
echo latest_tag=${TAG} >> $GITHUB_OUTPUT
63+
working-directory: ${{ github.workspace }}/src/${{ matrix.key }}
64+
65+
- name: Update dependency key
66+
run: |
67+
TAG_OVERRIDE=$(echo $TAG | sed 's/\//\\\//g')
68+
sed -i "s/$SEARCH/$PREFIX$TAG_OVERRIDE/g" $REQUIREMENTS
69+
env:
70+
PREFIX: ${{ matrix.prefix }}
71+
TAG: ${{ steps.latest_tag.outputs.latest_tag }}
72+
REQUIREMENTS: ${{ github.workspace }}/${{ matrix.path }}
73+
SEARCH: ${{ matrix.search_regex }}
74+
75+
- name: Propose changes via PR if required
76+
uses: peter-evans/create-pull-request@v7
77+
with:
78+
path: ${{ github.workspace }}/src/kayobe-config
79+
commit-message: >-
80+
Bump ${{ matrix.key }} to ${{ steps.latest_tag.outputs.latest_tag }}
81+
branch: update-dependency/${{ matrix.key }}
82+
delete-branch: true
83+
title: >-
84+
Bump ${{ matrix.key }} to ${{ steps.latest_tag.outputs.latest_tag }}
85+
body: >
86+
This PR was created automatically to update
87+
${{ matrix.key }} to ${{ steps.latest_tag.outputs.latest_tag }}.

etc/kayobe/stackhpc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ stackhpc_repo_elrepo_9_version: "{{ stackhpc_repo_distribution }}"
153153

154154
# Kolla source repository.
155155
stackhpc_kolla_source_url: "https://github.com/stackhpc/kolla"
156-
stackhpc_kolla_source_version: "stackhpc/{{ openstack_release }}"
156+
stackhpc_kolla_source_version: stackhpc/18.5.0.1
157157

158158
# Kolla Ansible source repository.
159159
stackhpc_kolla_ansible_source_url: "https://github.com/stackhpc/kolla-ansible"
160-
stackhpc_kolla_ansible_source_version: "stackhpc/{{ openstack_release }}"
160+
stackhpc_kolla_ansible_source_version: stackhpc/18.5.0.1
161161

162162
###############################################################################
163163
# Container image registry
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
features:
3+
- |
4+
Workflow to update Kolla dependencies (Kayobe, Kolla and Kolla-Ansible)
5+
to the latest tag available in the StackHPC branch via CI.

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
kayobe@git+https://github.com/stackhpc/kayobe@stackhpc/2024.1
1+
kayobe@git+https://github.com/stackhpc/kayobe@stackhpc/16.5.0.1
22
ansible-modules-hashivault>=5.2.1
33
jmespath

0 commit comments

Comments
 (0)