Skip to content

Commit

Permalink
Fix build and release logic for Unified (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrassia authored Jul 13, 2023
1 parent af320b2 commit 0141989
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ jobs:
IMAGE_TAG=$(echo "${SERVER_BRANCH}" | sed "s#/#-#g") # slash safe branch name
if [[ "${IMAGE_TAG}" == "master" ]]; then
IMAGE_TAG=dev
elif [[ ("{IMAGE_TAG}" == "rc") || ("${IMAGE_TAG}" == "hotfix-rc") ]]; then
IMAGE_TAG=beta
fi
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
Expand Down
30 changes: 6 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -338,18 +338,6 @@ jobs:
env:
_RELEASE_VERSION: ${{ github.event.inputs.release_version }}-beta # TODO: remove `-beta` after GA
steps:
- name: Setup
id: setup
env:
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
run: |
last_number=$(echo $RELEASE_VERSION | cut -d '.' -f 3)
if [ $last_number -eq 0 ]; then
echo "branch_name=rc" >> $GITHUB_OUTPUT
else
echo "branch_name=hotfix-rc" >> $GITHUB_OUTPUT
fi
########## DockerHub ##########
- name: Setup DCT
id: setup-dct
Expand All @@ -359,24 +347,20 @@ jobs:
azure-keyvault-name: "bitwarden-ci"

- name: Pull self-host image
env:
_BRANCH_NAME: ${{ steps.setup.outputs.branch_name }}
run: |
if [[ "${{ github.event.inputs.release_type }}" == "Dry Run" ]]; then
docker pull bitwarden/self-host:dev
else
docker pull bitwarden/self-host:$_BRANCH_NAME
docker pull bitwarden/self-host:beta
fi
- name: Tag version and latest
env:
_BRANCH_NAME: ${{ steps.setup.outputs.branch_name }}
run: |
if [[ "${{ github.event.inputs.release_type }}" == "Dry Run" ]]; then
docker tag bitwarden/self-host:dev bitwarden/self-host:dryrun
else
docker tag bitwarden/self-host:$_BRANCH_NAME bitwarden/self-host:$_RELEASE_VERSION
# docker tag bitwarden/self-host:$_BRANCH_NAME bitwarden/self-host:latest # TODO: uncomment this line after GA
docker tag bitwarden/self-host:beta bitwarden/self-host:$_RELEASE_VERSION
# docker tag bitwarden/self-host:beta bitwarden/self-host:latest # TODO: uncomment this line after GA
fi
- name: Push version and latest image
Expand Down Expand Up @@ -405,24 +389,22 @@ jobs:
- name: Pull latest project image
env:
REGISTRY: bitwardenprod.azurecr.io
_BRANCH_NAME: ${{ steps.setup.outputs.branch_name }}
run: |
if [[ "${{ github.event.inputs.release_type }}" == "Dry Run" ]]; then
docker pull $REGISTRY/self-host:dev
else
docker pull $REGISTRY/self-host:$_BRANCH_NAME
docker pull $REGISTRY/self-host:beta
fi
- name: Tag version and latest
env:
REGISTRY: bitwardenprod.azurecr.io
_BRANCH_NAME: ${{ steps.setup.outputs.branch_name }}
run: |
if [[ "${{ github.event.inputs.release_type }}" == "Dry Run" ]]; then
docker tag $REGISTRY/self-host:dev $REGISTRY/self-host:dryrun
else
docker tag $REGISTRY/self-host:$_BRANCH_NAME $REGISTRY/self-host:$_RELEASE_VERSION
docker tag $REGISTRY/self-host:$_BRANCH_NAME $REGISTRY/self-host:latest
docker tag $REGISTRY/self-host:beta $REGISTRY/self-host:$_RELEASE_VERSION
docker tag $REGISTRY/self-host:beta $REGISTRY/self-host:latest
fi
- name: Push version and latest image
Expand Down

0 comments on commit 0141989

Please sign in to comment.