Skip to content

Commit

Permalink
Merge pull request #212 from Scalr/feature/SCALRCORE-25384
Browse files Browse the repository at this point in the history
SCALRCORE-25384: GH Actions: Fix scalr_server_image_tag when scalr-se…
  • Loading branch information
abalakh committed Feb 15, 2023
2 parents f6f27ec + c6db84b commit a529b6e
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 [ ! -z "$API_BRANCH" ] && 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 a529b6e

Please sign in to comment.