Skip to content

Commit

Permalink
SCALRCORE-25384: GH Actions: Fix scalr_server_image_tag when scalr-se…
Browse files Browse the repository at this point in the history
…rver-te image exists
  • Loading branch information
AKramarenko committed Feb 15, 2023
1 parent f6f27ec commit 87a3326
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/default.yml
Expand Up @@ -88,6 +88,7 @@ jobs:
id: create
shell: bash
run: |
echo "::group::Analyze branches"
if [ -z ${{ env.API_BRANCH }} ]; then
FATMOUSE_BRANCH=""
else
Expand All @@ -103,8 +104,15 @@ jobs:
if [ "${{ env.API_BRANCH }}" = "staging" ]; then
IMAGE="--scalr-server-image-tag staging"
else
IMAGE=""
API_BRANCH=${{ env.API_BRANCH }}
NORMALIZED_BRANCH=$(echo $API_BRANCH | tr / - | tr '[:upper:]' '[:lower:]')
if docker manifest inspect eu.gcr.io/development-156220/fatmouse/scalr-server-te:${NORMALIZED_BRANCH} ; then
IMAGE="--scalr-server-image-tag ${NORMALIZED_BRANCH}"
else
IMAGE=""
fi
fi
echo "::endgroup::"
docker run --rm \
-e GITHUB_WORKSPACE=true \
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/upstream.yml
Expand Up @@ -83,6 +83,7 @@ jobs:
id: create
shell: bash
run: |
echo "::group::Analyze branches"
if [ ${{ env.API_BRANCH }} = "master" ]; then
FATMOUSE_BRANCH=""
else
Expand All @@ -98,8 +99,15 @@ jobs:
if [ ${{ env.API_BRANCH }} = "staging" ]; then
IMAGE="--scalr-server-image-tag staging"
else
IMAGE=""
API_BRANCH=${{ env.API_BRANCH }}
NORMALIZED_BRANCH=$(echo $API_BRANCH | tr / - | tr '[:upper:]' '[:lower:]')
if docker manifest inspect eu.gcr.io/development-156220/fatmouse/scalr-server-te:${NORMALIZED_BRANCH} ; then
IMAGE="--scalr-server-image-tag ${NORMALIZED_BRANCH}"
else
IMAGE=""
fi
fi
echo "::endgroup::"
docker run --rm \
-e GITHUB_WORKSPACE=true \
Expand Down

0 comments on commit 87a3326

Please sign in to comment.