chore(ci): build docker images for staging branch
Marcin Rataj committed
Oct 21, 2024 at 15:58 UTC
550f4642634ccc8bfd5f07c63be87a1160e4d02c
3 files changed
+11
-8
.github/workflows/docker-image.yml
+1
@@ -19,6 +19,7 @@ on:
19
push:
20
branches:
21
- 'master'
22
+ - 'staging'
23
- 'bifrost-*'
24
tags:
25
- 'v*'
bin/get-docker-tags.sh
+4
-4
@@ -18,7 +18,7 @@ set -euo pipefail
18
if [[ $# -lt 1 ]] ; then
19
echo 'At least 1 arg required.'
20
echo 'Usage:'
21
- echo './push-docker-tags.sh <build number> [git commit sha1] [git branch name] [git tag name]'
21
+ echo './get-docker-tags.sh <build number> [git commit sha1] [git branch name] [git tag name]'
22
exit 1
23
fi
24
@@ -50,9 +50,9 @@ elif [[ $GIT_BRANCH =~ ^bifrost-.* ]]; then
50
branch=$(echo "$GIT_BRANCH" | tr '/' '-' | tr --delete --complement '[:alnum:]-')
51
echoImageName "${branch}-${BUILD_NUM}-${GIT_SHA1_SHORT}"
52
53
-elif [ "$GIT_BRANCH" = "master" ]; then
54
- echoImageName "master-${BUILD_NUM}-${GIT_SHA1_SHORT}"
55
- echoImageName "master-latest"
53
+elif [ "$GIT_BRANCH" = "master" ] || [ "$GIT_BRANCH" = "staging" ]; then
54
+ echoImageName "${GIT_BRANCH}-${BUILD_NUM}-${GIT_SHA1_SHORT}"
55
+ echoImageName "${GIT_BRANCH}-latest"
56
57
else
58
echo "Nothing to do. No docker tag defined for branch: $GIT_BRANCH, tag: $GIT_TAG"
bin/push-docker-tags.sh
+6
-4
@@ -1,5 +1,7 @@
1
#!/usr/bin/env bash
2
-
2
+#
3
+# TODO: this script is legacy, use get-docker-tags.sh instead.
4
+#
5
# push-docker-tags.sh
6
#
7
# Run from ci to tag images based on the current branch or tag name.
@@ -68,9 +70,9 @@ elif [[ $GIT_BRANCH =~ ^bifrost-.* ]]; then
70
branch=$(echo "$GIT_BRANCH" | tr '/' '-' | tr --delete --complement '[:alnum:]-')
71
pushTag "${branch}-${BUILD_NUM}-${GIT_SHA1_SHORT}"
72
71
-elif [ "$GIT_BRANCH" = "master" ]; then
72
- pushTag "master-${BUILD_NUM}-${GIT_SHA1_SHORT}"
73
- pushTag "master-latest"
73
+elif [ "$GIT_BRANCH" = "master" ] || [ "$GIT_BRANCH" = "staging" ]; then
74
+ pushTag "${GIT_BRANCH}-${BUILD_NUM}-${GIT_SHA1_SHORT}"
75
+ pushTag "${GIT_BRANCH}-latest"
76
77
else
78
echo "Nothing to do. No docker tag defined for branch: $GIT_BRANCH, tag: $GIT_TAG"