Skip to content

Commit 8658a8d

Browse files
Automated Kolla dependencies updates
1 parent aae4d8d commit 8658a8d

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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+
repo_path: ${{ github.workspace }}/src/kolla
18+
path: ${{ github.workspace }}/src/kayobe-config/etc/kayobe/stackhpc.yml
19+
repository: stackhpc/kolla
20+
version_jsonpath: stackhpc_kolla_source_version
21+
22+
- key: kolla-ansible
23+
repo_path: ${{ github.workspace }}/src/kolla-ansible
24+
path: ${{ github.workspace }}/src/kayobe-config/etc/kayobe/stackhpc.yml
25+
repository: stackhpc/kolla-ansible
26+
version_jsonpath: stackhpc_kolla_ansible_source_version
27+
28+
- key: kayobe
29+
repo_path: ${{ github.workspace }}/src/kayobe
30+
path: ${{ github.workspace }}/src/kayobe-config/requirements.txt
31+
repository: stackhpc/kayobe
32+
permissions:
33+
contents: write
34+
pull-requests: write
35+
name: ${{ matrix.key }}
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
path: ${{ github.workspace }}/src/kayobe-config
40+
41+
- name: Determine OpenStack release
42+
id: openstack_release
43+
run: |
44+
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' src/kayobe-config/.gitreview)
45+
echo "openstack_release=${BRANCH}" | sed -E "s,(stable|unmaintained)/,," >> $GITHUB_OUTPUT
46+
47+
- name: Checkout the dependency repo
48+
uses: actions/checkout@v4
49+
with:
50+
repository: ${{ matrix.repository }}
51+
ref: stackhpc/${{ steps.openstack_release.outputs.openstack_release }}
52+
path: ${{ matrix.repo_path }}
53+
54+
- name: Get latest tag
55+
id: latest_tag
56+
run: |
57+
TAG=$(git describe --tags --abbrev=0 --match stackhpc/\*)
58+
echo latest_tag=${TAG} >> $GITHUB_OUTPUT
59+
working-directory: ${{ matrix.repo_path }}
60+
61+
- name: Update dependency key (kolla)
62+
uses: azimuth-cloud/github-actions/config-update@master
63+
with:
64+
path: ${{ matrix.path }}
65+
updates: |
66+
${{ matrix.version_jsonpath }}=${{ steps.latest_tag.outputs.latest_tag }}
67+
if: contains(matrix.key, 'kolla')
68+
69+
- name: Update dependency key (kayobe)
70+
run: |
71+
REPLACE=$(sed -i "s/@stackhpc\/.*$/$TAG/g" $REQUIREMENTS)
72+
if: contains(matrix.key, 'kayobe')
73+
env:
74+
TAG: ${{ steps.latest_tag.outputs.latest_tag }}
75+
REQUIREMENTS: ${{ matrix.path }}

0 commit comments

Comments
 (0)