35
35
env :
36
36
ANSIBLE_FORCE_COLOR : True
37
37
jobs :
38
+ generate-tag :
39
+ name : Generate container image tag
40
+ if : github.repository == 'stackhpc/stackhpc-kayobe-config'
41
+ runs-on : [self-hosted, stackhpc-kayobe-config-kolla-builder]
42
+ permissions : {}
43
+ outputs :
44
+ openstack_release : ${{ steps.openstack_release.outputs.openstack_release }}
45
+ kolla_tag : ${{ steps.kolla_tag.outputs.kolla_tag }}
46
+ steps :
47
+ - name : Checkout
48
+ uses : actions/checkout@v3
49
+
50
+ - name : Determine OpenStack release
51
+ id : openstack_release
52
+ run : |
53
+ BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' .gitreview)
54
+ echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
55
+
56
+ # Generate a tag to apply to all built container images.
57
+ # Without this, each kayobe * container image build command would use a different tag.
58
+ - name : Generate container image tag
59
+ id : kolla_tag
60
+ run : |
61
+ echo "kolla_tag=$(date +${{ steps.openstack_release.outputs.openstack_release }}-%Y%m%dT%H%M%S)" >> $GITHUB_OUTPUT
62
+
63
+ - name : Display container image tag
64
+ run : |
65
+ echo "${{ steps.kolla_tag.outputs.kolla_tag }}"
66
+
38
67
container-image-build :
39
68
name : Build Kolla container images
40
69
if : github.repository == 'stackhpc/stackhpc-kayobe-config'
41
70
runs-on : [self-hosted, stackhpc-kayobe-config-kolla-builder]
71
+ needs :
72
+ - generate-tag
42
73
steps :
43
74
- uses : actions/checkout@v3
44
75
with :
48
79
uses : actions/checkout@v3
49
80
with :
50
81
repository : stackhpc/kayobe
51
- ref : refs/heads/stackhpc/wallaby
82
+ ref : refs/heads/stackhpc/${{ needs.generate-tag.outputs.openstack_release }}
52
83
path : src/kayobe
53
84
54
85
# FIXME: Failed in kolla-ansible : Ensure the latest version of pip is installed
@@ -104,13 +135,13 @@ jobs:
104
135
105
136
- name : Build and push kolla overcloud images
106
137
run : |
107
- args="${{ github.event.inputs.regexes }} -e kolla_base_distro=${{ inputs.distro }}"
138
+ args="${{ github.event.inputs.regexes }} -e kolla_base_distro=${{ inputs.distro }} -e kolla_tag=${{ needs.generate-tag.outputs.kolla_tag }} "
108
139
if ${{ inputs.push }} == 'true'; then
109
140
args="$args --push"
110
141
fi
111
142
source venvs/kayobe/bin/activate &&
112
143
source src/kayobe-config/kayobe-env --environment ci-builder &&
113
- kayobe overcloud container image build " $args"
144
+ kayobe overcloud container image build $args
114
145
env :
115
146
KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
116
147
if : github.event.inputs.overcloud == 'true'
@@ -135,13 +166,13 @@ jobs:
135
166
136
167
- name : Build and push kolla seed images
137
168
run : |
138
- args="kolla_base_distro=${{ inputs.distro }}"
169
+ args="kolla_base_distro=${{ inputs.distro }} -e kolla_tag=${{ needs.generate-tag.outputs.kolla_tag }} "
139
170
if ${{ inputs.push }} == 'true'; then
140
171
args="$args --push"
141
172
fi
142
173
source venvs/kayobe/bin/activate &&
143
174
source src/kayobe-config/kayobe-env --environment ci-builder &&
144
- kayobe seed container image build " $args"
175
+ kayobe seed container image build $args
145
176
env :
146
177
KAYOBE_VAULT_PASSWORD : ${{ secrets.KAYOBE_VAULT_PASSWORD }}
147
178
if : github.event.inputs.seed == 'true'
0 commit comments