1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-05 05:00:19 -05:00

QA eventsprocessor (#1389)

* adding the EventProcessor docker container

* fixing the matrix name in the setup step

* changing the name of the EventsProcessor application

* adding the missing docker repo login as well as changing how we are setting the docker trust environment variables
This commit is contained in:
Joseph Flinn 2021-06-14 11:11:05 -07:00 committed by GitHub
parent ac7ee873ac
commit c3642adbdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,43 +76,61 @@ jobs:
include: include:
- service_name: Admin - service_name: Admin
base_path: ./src base_path: ./src
docker_repo: bitwarden
dotnet: true dotnet: true
gulp: true gulp: true
- service_name: Api - service_name: Api
base_path: ./src base_path: ./src
docker_repo: bitwarden
dotnet: true dotnet: true
- service_name: Attachments - service_name: Attachments
base_path: ./util base_path: ./util
docker_repo: bitwarden
- service_name: Events - service_name: Events
base_path: ./src base_path: ./src
docker_repo: bitwarden
dotnet: true
- service_name: EventsProcessor
base_path: ./src
docker_repo: bitwardenqa.azurecr.io
dotnet: true dotnet: true
- service_name: Icons - service_name: Icons
base_path: ./src base_path: ./src
docker_repo: bitwarden
dotnet: true dotnet: true
- service_name: Identity - service_name: Identity
base_path: ./src base_path: ./src
docker_repo: bitwarden
dotnet: true dotnet: true
- service_name: K8S-Proxy - service_name: K8S-Proxy
base_path: ./util base_path: ./util
docker_repo: bitwarden
- service_name: MsSql - service_name: MsSql
base_path: ./util base_path: ./util
docker_repo: bitwarden
- service_name: Nginx - service_name: Nginx
base_path: ./util base_path: ./util
docker_repo: bitwarden
- service_name: Notifications - service_name: Notifications
base_path: ./src base_path: ./src
docker_repo: bitwarden
dotnet: true dotnet: true
- service_name: Portal - service_name: Portal
base_path: ./bitwarden_license/src base_path: ./bitwarden_license/src
docker_repo: bitwarden
dotnet: true dotnet: true
gulp: true gulp: true
- service_name: Server - service_name: Server
base_path: ./util base_path: ./util
docker_repo: bitwarden
dotnet: true dotnet: true
- service_name: Setup - service_name: Setup
base_path: ./util base_path: ./util
docker_repo: bitwarden
dotnet: true dotnet: true
- service_name: Sso - service_name: Sso
base_path: ./bitwarden_license/src base_path: ./bitwarden_license/src
docker_repo: bitwarden
dotnet: true dotnet: true
gulp: true gulp: true
steps: steps:
@ -152,7 +170,12 @@ jobs:
- name: Log into Docker - name: Log into Docker
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin run: |
if [[ "${{ matrix.docker_repo }}" == "bitwardenqa.azurecr.io" ]]; then
az acr login -n bitwardenqa
else
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
env: env:
DOCKER_USERNAME: ${{ steps.retrieve-secrets.outputs.docker-username }} DOCKER_USERNAME: ${{ steps.retrieve-secrets.outputs.docker-username }}
DOCKER_PASSWORD: ${{ steps.retrieve-secrets.outputs.docker-password }} DOCKER_PASSWORD: ${{ steps.retrieve-secrets.outputs.docker-password }}
@ -167,6 +190,14 @@ jobs:
DCT_DELEGATION_KEY_ID: "c9bde8ec820701516491e5e03d3a6354e7bd66d05fa3df2b0062f68b116dc59c" DCT_DELEGATION_KEY_ID: "c9bde8ec820701516491e5e03d3a6354e7bd66d05fa3df2b0062f68b116dc59c"
DCT_DELEGATE_KEY: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-key }} DCT_DELEGATE_KEY: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-key }}
- name: Setup service name
id: setup
run: |
SERVICE_NAME=$(echo "${{ matrix.service_name }}" | awk '{print tolower($0)}')
echo "Matrix name: ${{ matrix.service_name }}"
echo "SERVICE_NAME: $SERVICE_NAME"
echo "::set-output name=service_name::$SERVICE_NAME"
- name: Set up Gulp - name: Set up Gulp
if: ${{ matrix.gulp }} if: ${{ matrix.gulp }}
working-directory: ${{ matrix.base_path }}/${{ matrix.service_name }} working-directory: ${{ matrix.base_path }}/${{ matrix.service_name }}
@ -203,46 +234,43 @@ jobs:
- name: Build Docker images - name: Build Docker images
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
run: | run: |
SERVICE_NAME=$(echo "${{ matrix.service_name }}" | tr '[:upper:]' '[:lower:]') if [ "${{ steps.setup.outputs.service_name }}" = "k8s-proxy" ]; then
if [ "$SERVICE_NAME" = "k8s-proxy" ]; then docker build -f ${{ matrix.base_path }}/Nginx/Dockerfile-k8s -t ${{ matrix.docker_repo }}/${{ steps.setup.outputs.service_name }} ${{ matrix.base_path }}/Nginx
docker build -f ${{ matrix.base_path }}/Nginx/Dockerfile-k8s -t bitwarden/$SERVICE_NAME ${{ matrix.base_path }}/Nginx
else else
docker build -t bitwarden/$SERVICE_NAME ${{ matrix.base_path }}/${{ matrix.service_name }} docker build -t ${{ matrix.docker_repo }}/${{ steps.setup.outputs.service_name }} ${{ matrix.base_path }}/${{ matrix.service_name }}
fi fi
- name: Tag rc - name: Tag rc
if: github.ref == 'refs/heads/rc' if: github.ref == 'refs/heads/rc'
run: | run: |
SERVICE_NAME=$(echo "${{ matrix.service_name }}" | tr '[:upper:]' '[:lower:]') docker tag ${{ matrix.docker_repo }}/${{ steps.setup.outputs.service_name }} ${{ matrix.docker_repo }}/${{ steps.setup.outputs.service_name }}:rc
docker tag bitwarden/$SERVICE_NAME bitwarden/$SERVICE_NAME:rc
- name: Tag dev - name: Tag dev
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
run: | run: |
SERVICE_NAME=$(echo "${{ matrix.service_name }}" | tr '[:upper:]' '[:lower:]') docker tag ${{ matrix.docker_repo }}/${{ steps.setup.outputs.service_name }} ${{ matrix.docker_repo }}/${{ steps.setup.outputs.service_name }}:dev
docker tag bitwarden/$SERVICE_NAME bitwarden/$SERVICE_NAME:dev
- name: List Docker images - name: List Docker images
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
run: docker images run: docker images
- name: Docker Trust setup
run: |
if [[ "${{ matrix.docker_repo }}" == "bitwarden" ]]; then
echo "DOCKER_CONTENT_TRUST=1" >> $GITHUB_ENV
echo "DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE=${{ steps.retrieve-secrets.outputs.dct-delegate-2-repo-passphrase }}" >> $GITHUB_ENV
fi
- name: Push rc images - name: Push rc images
if: github.ref == 'refs/heads/rc' if: github.ref == 'refs/heads/rc'
run: | run: |
SERVICE_NAME=$(echo "${{ matrix.service_name }}" | tr '[:upper:]' '[:lower:]') docker push ${{ matrix.docker_repo }}/${{ steps.setup.outputs.service_name }}:rc
docker push bitwarden/$SERVICE_NAME:rc
env: env:
DOCKER_CONTENT_TRUST: 1
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-repo-passphrase }}
- name: Push dev images - name: Push dev images
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
run: | run: |
SERVICE_NAME=$(echo "${{ matrix.service_name }}" | tr '[:upper:]' '[:lower:]') docker push ${{ matrix.docker_repo }}/${{ steps.setup.outputs.service_name }}:dev
docker push bitwarden/$SERVICE_NAME:dev
env:
DOCKER_CONTENT_TRUST: 1
DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-repo-passphrase }}
- name: Log out of Docker - name: Log out of Docker
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'