Skip to content

Commit ba1024b

Browse files
authored
Merging to release-5.2.1: [TD-2193] Use correct tags for CI push and CI test (#5465)
[TD-2193] Use correct tags for CI push and CI test (#5465) The old architecture of doing ci in a separate job made the larger workflow seemingly more resilient but as the automation grows, failures in CI will make the remainder of the release process unprocessable. So doubling down on making CI push robust. Removed ci/auto as it lives in tyk-ci now. Tested by re-using [v5.2.1-alpha](https://github.com/TykTechnologies/tyk/actions/runs/5971645065).
1 parent ecedba8 commit ba1024b

26 files changed

Lines changed: 19 additions & 826 deletions

.github/workflows/release.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,13 @@ jobs:
142142
shell: bash
143143
env:
144144
t: ${{ steps.metadata.outputs.tags }}
145+
build_tag: ${{ startswith(github.ref, 'refs/tags') && github.ref_name || 'v0.0.0' }}
145146
run: |
146147
set +e
147148
IFS=$'\n' tags=($t)
148149
for tag in $tags; do
149150
for arch in amd64 arm64; do
150-
docker tag tykio/tyk-gateway:v0.0.0-${arch} ${tag}-${arch} && docker push ${tag}-${arch}
151+
docker tag tykio/tyk-gateway:${build_tag}-${arch} ${tag}-${arch} && docker push ${tag}-${arch}
151152
done
152153
docker manifest create ${tag} ${tag}-amd64 ${tag}-arm64 && docker manifest push ${tag}
153154
done
@@ -217,31 +218,40 @@ jobs:
217218

218219
- name: env up
219220
shell: bash
220-
working-directory: ci/auto
221221
env:
222222
t: ${{ needs.goreleaser.outputs.tags }}
223+
# gw and dash use the same branch names
224+
gw_dash_image_tag: ${{ ( (github.repository == 'TykTechnologies/tyk' || github.repository == 'TykTechnologies/tyk-analytics') && startsWith(github.ref_name, 'release-') ) && github.ref_name || 'master' }}
225+
pump_image_tag: ${{ ( github.repository == 'TykTechnologies/tyk-pump' && startsWith(github.ref_name, 'release-') ) && github.ref_name || 'master' }}
226+
sink_image_tag: ${{ ( github.repository == 'TykTechnologies/tyk-sink' && startsWith(github.ref_name, 'release-') ) && github.ref_name || 'master' }}
223227
TYK_DB_LICENSEKEY: ${{ secrets.DASH_LICENSE }}
224228
TYK_MDCB_LICENSE: ${{ secrets.MDCB_LICENSE }}
229+
GH_TOKEN: ${{ secrets.ORG_GH_TOKEN }}
225230
run: |
226231
echo CI tags: $t
227232
tags=($t)
228233
echo First tag: ${tags[0]}
234+
# Get the ci test env in a temp dir
235+
cd $(mktemp -d autoXXX)
236+
gh release download v1 --pattern '*.tgz' -R TykTechnologies/tyk-ci
237+
tar --strip-components=1 -xvf ci-env.tgz
238+
# Start customising env
229239
echo "registry=${{ steps.ecr.outputs.registry }}
230-
tyk_image=\${registry}/tyk:${{ startsWith(github.ref_name, 'release-') && github.ref_name || 'master' }}
231-
tyk_analytics_image=\${registry}/tyk-analytics:${{ startsWith(github.ref_name, 'release-') && github.ref_name || 'master' }}
232-
tyk_sink_image=\${registry}/tyk-sink:${{ startsWith(github.ref_name, 'release-') && github.ref_name || 'master' }}
233-
tyk_pump_image=\${registry}/tyk-pump:${{ startsWith(github.ref_name, 'release-') && github.ref_name || 'master' }}
240+
tyk_image=\${registry}/tyk:${gw_dash_image_tag}
241+
tyk_analytics_image=\${registry}/tyk-analytics:${gw_dash_image_tag}
242+
tyk_sink_image=\${registry}/tyk-sink:${sink_image_tag}
243+
tyk_pump_image=\${registry}/tyk-pump:${pump_image_tag}
234244
# override default with just built tag
235245
tyk_image=${tags[0]}
236246
# base dir for config files
237247
confs_dir=./pro
238-
# overrides via envvars
248+
# pick database
239249
env_file=local-${{ matrix.db }}.env
240250
" > versions.env
241251
# Add Tyk component config variations to $env_file
242252
cat confs/${{ matrix.conf }}.env >> local-${{ matrix.db }}.env
243-
# bring up env
244-
docker compose -f pro.yml -f deps.yml -f ${{ matrix.db }}.yml --env-file versions.env up --quiet-pull -d
253+
# bring up env, the project name is important
254+
docker compose -p auto -f pro.yml -f deps.yml -f ${{ matrix.db }}.yml --env-file versions.env up --quiet-pull -d
245255
246256
- name: Run tests
247257
run: |

ci/auto/Makefile

Lines changed: 0 additions & 15 deletions
This file was deleted.

ci/auto/README.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

ci/auto/bundle-server/Dockerfile

Lines changed: 0 additions & 5 deletions
This file was deleted.
-951 Bytes
Binary file not shown.
-1.07 KB
Binary file not shown.
-2.04 KB
Binary file not shown.
-706 Bytes
Binary file not shown.
-704 Bytes
Binary file not shown.
-888 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)