Skip to content

Commit

Permalink
Add EE specific web container image (#3604)
Browse files Browse the repository at this point in the history
* Add build command for ee

* Add config for ee

* Add build workflow for ee

* Change build pipeline for web ee

* Fix name of workflow in trigger

* Build ee image in web build workflow

* Fix name on matrix

* FIx name of the artifact

* Comment out zip extract

* Add zip extract

* All listing dir before unzip

* Add pwd

* Comment out unzipping

* Fix

* Add matrix instead of two stages

* Remove build web ee workflow

* Fix name
  • Loading branch information
michalchecinski authored Sep 29, 2022
1 parent 24a7abb commit b91e291
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 27 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/build-web-ee.yml

This file was deleted.

37 changes: 26 additions & 11 deletions .github/workflows/build-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ jobs:
npm_command: "dist:bit:selfhost"
- name: "cloud-QA"
npm_command: "build:bit:qa"
- name: "ee"
npm_command: "build:bit:ee"

steps:
- name: Checkout repo
Expand Down Expand Up @@ -234,12 +236,20 @@ jobs:
- name: Log out of Docker
run: docker logout

build-qa:
name: Build Docker images for QA environment
build-containers:
name: Build Docker images for bitwardenqa
runs-on: ubuntu-22.04
needs:
- setup
- build-artifacts
strategy:
fail-fast: false
matrix:
include:
- artifact_name: cloud-QA
image_name: web
- artifact_name: ee
image_name: web-ee
env:
_VERSION: ${{ needs.setup.outputs.version }}
steps:
Expand All @@ -254,17 +264,17 @@ jobs:
- name: Log into container registry
run: az acr login -n bitwardenqa

- name: Download cloud-QA artifact
- name: Download ${{ matrix.artifact_name }} artifact
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741
with:
name: web-${{ env._VERSION }}-cloud-QA.zip
name: web-${{ env._VERSION }}-${{ matrix.artifact_name }}.zip
path: apps/web/build

- name: Build Docker image
working-directory: apps/web
run: |
docker --version
docker build -t bitwardenqa.azurecr.io/web .
docker build -t bitwardenqa.azurecr.io/${{ matrix.image_name }} .
- name: Get image tag
id: image-tag
Expand All @@ -286,25 +296,30 @@ jobs:
- name: Tag image
env:
IMAGE_TAG: ${{ steps.image-tag.outputs.value }}
run: docker tag bitwardenqa.azurecr.io/web "bitwardenqa.azurecr.io/web:$IMAGE_TAG"
IMAGE_NAME: ${{ matrix.image_name }}
run: docker tag bitwardenqa.azurecr.io/$IMAGE_NAME "bitwardenqa.azurecr.io/$IMAGE_NAME:$IMAGE_TAG"

- name: Tag dev
if: github.ref == 'refs/heads/master'
run: docker tag bitwardenqa.azurecr.io/web bitwardenqa.azurecr.io/web:dev
env:
IMAGE_NAME: ${{ matrix.image_name }}
run: docker tag bitwardenqa.azurecr.io/web "bitwardenqa.azurecr.io/$IMAGE_NAME:dev"

- name: Push image
env:
IMAGE_TAG: ${{ steps.image-tag.outputs.value }}
run: docker push "bitwardenqa.azurecr.io/web:$IMAGE_TAG"
IMAGE_NAME: ${{ matrix.image_name }}
run: docker push "bitwardenqa.azurecr.io/$IMAGE_NAME:$IMAGE_TAG"

- name: Push dev images
if: github.ref == 'refs/heads/master'
run: docker push bitwardenqa.azurecr.io/web:dev
env:
IMAGE_NAME: ${{ matrix.image_name }}
run: docker push "bitwardenqa.azurecr.io/$IMAGE_NAME:dev"

- name: Log out of Docker
run: docker logout


crowdin-push:
name: Crowdin Push
if: github.ref == 'refs/heads/master'
Expand Down Expand Up @@ -355,8 +370,8 @@ jobs:
- cloc
- setup
- build-artifacts
- build-containers
- build-commercial-selfhost-image
- build-qa
- crowdin-push
steps:
- name: Check if any job failed
Expand Down
12 changes: 12 additions & 0 deletions apps/web/config/ee.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"dev": {
"proxyApi": "http://localhost:4001",
"proxyIdentity": "http://localhost:33657",
"proxyEvents": "http://localhost:46274",
"proxyNotifications": "http://localhost:61841",
"port": 8081
},
"flags": {
"showTrial": false
}
}
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"build:bit:selfhost:watch": "cross-env ENV=selfhosted npm run build:bit:watch",
"build:oss:selfhost:prod": "cross-env ENV=selfhosted NODE_ENV=production npm run build:oss",
"build:bit:selfhost:prod": "cross-env ENV=selfhosted NODE_ENV=production npm run build:bit",
"build:bit:ee": "cross-env NODE_ENV=production ENV=ee npm run build:bit",
"clean:l10n": "git push origin --delete l10n_master",
"dist:bit:cloud": "npm run build:bit:cloud",
"dist:oss:selfhost": "npm run build:oss:selfhost:prod",
Expand Down

0 comments on commit b91e291

Please sign in to comment.