Skip to content

Commit 550f464

Browse files
committed
chore(ci): build docker images for staging branch
1 parent 16c90f0 commit 550f464

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

.github/workflows/docker-image.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
push:
2020
branches:
2121
- 'master'
22+
- 'staging'
2223
- 'bifrost-*'
2324
tags:
2425
- 'v*'

bin/get-docker-tags.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ set -euo pipefail
1818
if [[ $# -lt 1 ]] ; then
1919
echo 'At least 1 arg required.'
2020
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]'
2222
exit 1
2323
fi
2424

@@ -50,9 +50,9 @@ elif [[ $GIT_BRANCH =~ ^bifrost-.* ]]; then
5050
branch=$(echo "$GIT_BRANCH" | tr '/' '-' | tr --delete --complement '[:alnum:]-')
5151
echoImageName "${branch}-${BUILD_NUM}-${GIT_SHA1_SHORT}"
5252

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"
5656

5757
else
5858
echo "Nothing to do. No docker tag defined for branch: $GIT_BRANCH, tag: $GIT_TAG"

bin/push-docker-tags.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
2-
2+
#
3+
# TODO: this script is legacy, use get-docker-tags.sh instead.
4+
#
35
# push-docker-tags.sh
46
#
57
# Run from ci to tag images based on the current branch or tag name.
@@ -68,9 +70,9 @@ elif [[ $GIT_BRANCH =~ ^bifrost-.* ]]; then
6870
branch=$(echo "$GIT_BRANCH" | tr '/' '-' | tr --delete --complement '[:alnum:]-')
6971
pushTag "${branch}-${BUILD_NUM}-${GIT_SHA1_SHORT}"
7072

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"
7476

7577
else
7678
echo "Nothing to do. No docker tag defined for branch: $GIT_BRANCH, tag: $GIT_TAG"

0 commit comments

Comments
 (0)