1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-02 13:53:23 +01:00
bitwarden-server/.github/workflows/build.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

524 lines
18 KiB
YAML
Raw Normal View History

---
2020-07-17 16:51:32 +02:00
name: Build
on:
push:
branches-ignore:
- 'l10n_master'
- 'gh-pages'
paths-ignore:
- '.github/workflows/**'
Automating Server Release/Deploy for QA Env (#1281) * initial success caching test * updating status testing * fixing the fail check * fixing bash if syntax * changing the way of testing since you can't change workflow inputs between re-runs * trying out different bash syntax * removing the export to env * adding in last run status check * switching up the last_run_status file handling since it doesn't look like it is working correctly * adding push trigger * fixing typo * adding date to the cache key and adding a bit more logging * fixing restore key * trying a different way of logging both successes and failures * fixing typo * reorganizing the random success/fail * trying different bash * fixing binary operator * adding in success flag checks * increasing the odds of success * trying to fix weird problem * changing dquotes to squotes * testing failure and always() flow * adding in a release pipeline * adding in the manual trigger for the release pipeline * fixing the bash for loop for tagging and switching to the rc image for release * adding docker trust to the pull task * fixing bash array typo * removing build task * adding the dotnet tool restore back in to hopefully restore swagger * adding an Api build to build the swagger docs * working on build workflow * testing cache between jobs * Adding in steps * fixing the last line * updating the build workflow * adding manual trigger for build workflow * moving the matrix values to the env section of the task * changing the envs * using env template replacement * removing the unique id since I don't think I need it * testing the cache * commenting out the docker push * adding the env vars back to the cache task * adding envs to test * fixing the path issue * resetting the build workflow back to serial build/docker * Adding in the qa release workflow * removing unneccessary dependency * parameterizing the project file names * forcing gulp install * installing gulp globally * reorganizing to see if gulp works * removing the awkward paths * fixing typo * commenting out all non-api matrix for easier testing * trying to zip the build for deploy * adding in the base path for the test * replacing the web app name * adding a specific slotname * adding the env into the package path for the deployment * trying to fix the zip * setting up all of the other deploys * switching the secrets over to be environment secrets * adding in production automation with the deploys commented out * removing the master branch from the QA deploy * adding in the dependancy on the setup * changing the tag * trying a different ref * renaming the deployment slot to staging * trying a different slot name * resetting the qa deploy to the original * moving the secrets * updating the qa deploy with the db reset/update stubs * updating the deploy task dependencies * adding missing update-db command placeholder * trying a string for the inputs * moving the input check into the steps instead of the job level so that the job completes * testing azure kv * fixing typo * Change id to retrieve-secrets * Fix typo * testing the rest of the QA app service deployments * updating the name of the QA AZ creds secret and migrating the disabled prod deploy jobs to use the prod AZ secrets * adding in the additional key vault secrets and fixing some other mistakes * fixing one of the other preview versions * removing newline for testing commit * fixing typo * fixing a secret name typo * moving the secrets to the env to test their outputs * adding missing k * Update build workflow with environment variables for Docker Trust * removing the unneeded env vars * Update build and release workflow using Azure secrets as env variables * Clean up output of NuGet version * Fix capitalization * Fix variable names for Docker Trust Setup * fixing the dashes in the env ids * switching the dev tag for qa when pushing * commenting out the test for the pipeline testing * removing all of the testing code and blockers Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2021-05-04 22:41:49 +02:00
workflow_dispatch:
inputs: {}
2020-07-17 16:51:32 +02:00
jobs:
2020-07-17 17:04:21 +02:00
cloc:
name: CLOC
runs-on: ubuntu-20.04
2020-07-17 17:04:21 +02:00
steps:
- name: Checkout repo
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
2020-07-17 17:04:21 +02:00
- name: Install cloc
2020-07-17 17:04:21 +02:00
run: |
sudo apt-get update
sudo apt-get -y install cloc
- name: Print lines of code
run: cloc --include-lang C#,SQL,Razor,"Bourne Shell",PowerShell,HTML,CSS,Sass,JavaScript,TypeScript --vcs git
2022-03-14 14:31:03 +01:00
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- name: Verify Format
run: dotnet format --verify-no-changes
2022-03-14 14:31:03 +01:00
Automating Server Release/Deploy for QA Env (#1281) * initial success caching test * updating status testing * fixing the fail check * fixing bash if syntax * changing the way of testing since you can't change workflow inputs between re-runs * trying out different bash syntax * removing the export to env * adding in last run status check * switching up the last_run_status file handling since it doesn't look like it is working correctly * adding push trigger * fixing typo * adding date to the cache key and adding a bit more logging * fixing restore key * trying a different way of logging both successes and failures * fixing typo * reorganizing the random success/fail * trying different bash * fixing binary operator * adding in success flag checks * increasing the odds of success * trying to fix weird problem * changing dquotes to squotes * testing failure and always() flow * adding in a release pipeline * adding in the manual trigger for the release pipeline * fixing the bash for loop for tagging and switching to the rc image for release * adding docker trust to the pull task * fixing bash array typo * removing build task * adding the dotnet tool restore back in to hopefully restore swagger * adding an Api build to build the swagger docs * working on build workflow * testing cache between jobs * Adding in steps * fixing the last line * updating the build workflow * adding manual trigger for build workflow * moving the matrix values to the env section of the task * changing the envs * using env template replacement * removing the unique id since I don't think I need it * testing the cache * commenting out the docker push * adding the env vars back to the cache task * adding envs to test * fixing the path issue * resetting the build workflow back to serial build/docker * Adding in the qa release workflow * removing unneccessary dependency * parameterizing the project file names * forcing gulp install * installing gulp globally * reorganizing to see if gulp works * removing the awkward paths * fixing typo * commenting out all non-api matrix for easier testing * trying to zip the build for deploy * adding in the base path for the test * replacing the web app name * adding a specific slotname * adding the env into the package path for the deployment * trying to fix the zip * setting up all of the other deploys * switching the secrets over to be environment secrets * adding in production automation with the deploys commented out * removing the master branch from the QA deploy * adding in the dependancy on the setup * changing the tag * trying a different ref * renaming the deployment slot to staging * trying a different slot name * resetting the qa deploy to the original * moving the secrets * updating the qa deploy with the db reset/update stubs * updating the deploy task dependencies * adding missing update-db command placeholder * trying a string for the inputs * moving the input check into the steps instead of the job level so that the job completes * testing azure kv * fixing typo * Change id to retrieve-secrets * Fix typo * testing the rest of the QA app service deployments * updating the name of the QA AZ creds secret and migrating the disabled prod deploy jobs to use the prod AZ secrets * adding in the additional key vault secrets and fixing some other mistakes * fixing one of the other preview versions * removing newline for testing commit * fixing typo * fixing a secret name typo * moving the secrets to the env to test their outputs * adding missing k * Update build workflow with environment variables for Docker Trust * removing the unneeded env vars * Update build and release workflow using Azure secrets as env variables * Clean up output of NuGet version * Fix capitalization * Fix variable names for Docker Trust Setup * fixing the dashes in the env ids * switching the dev tag for qa when pushing * commenting out the test for the pipeline testing * removing all of the testing code and blockers Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2021-05-04 22:41:49 +02:00
testing:
name: Testing
runs-on: windows-2022
2022-02-10 15:40:31 +01:00
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
Automating Server Release/Deploy for QA Env (#1281) * initial success caching test * updating status testing * fixing the fail check * fixing bash if syntax * changing the way of testing since you can't change workflow inputs between re-runs * trying out different bash syntax * removing the export to env * adding in last run status check * switching up the last_run_status file handling since it doesn't look like it is working correctly * adding push trigger * fixing typo * adding date to the cache key and adding a bit more logging * fixing restore key * trying a different way of logging both successes and failures * fixing typo * reorganizing the random success/fail * trying different bash * fixing binary operator * adding in success flag checks * increasing the odds of success * trying to fix weird problem * changing dquotes to squotes * testing failure and always() flow * adding in a release pipeline * adding in the manual trigger for the release pipeline * fixing the bash for loop for tagging and switching to the rc image for release * adding docker trust to the pull task * fixing bash array typo * removing build task * adding the dotnet tool restore back in to hopefully restore swagger * adding an Api build to build the swagger docs * working on build workflow * testing cache between jobs * Adding in steps * fixing the last line * updating the build workflow * adding manual trigger for build workflow * moving the matrix values to the env section of the task * changing the envs * using env template replacement * removing the unique id since I don't think I need it * testing the cache * commenting out the docker push * adding the env vars back to the cache task * adding envs to test * fixing the path issue * resetting the build workflow back to serial build/docker * Adding in the qa release workflow * removing unneccessary dependency * parameterizing the project file names * forcing gulp install * installing gulp globally * reorganizing to see if gulp works * removing the awkward paths * fixing typo * commenting out all non-api matrix for easier testing * trying to zip the build for deploy * adding in the base path for the test * replacing the web app name * adding a specific slotname * adding the env into the package path for the deployment * trying to fix the zip * setting up all of the other deploys * switching the secrets over to be environment secrets * adding in production automation with the deploys commented out * removing the master branch from the QA deploy * adding in the dependancy on the setup * changing the tag * trying a different ref * renaming the deployment slot to staging * trying a different slot name * resetting the qa deploy to the original * moving the secrets * updating the qa deploy with the db reset/update stubs * updating the deploy task dependencies * adding missing update-db command placeholder * trying a string for the inputs * moving the input check into the steps instead of the job level so that the job completes * testing azure kv * fixing typo * Change id to retrieve-secrets * Fix typo * testing the rest of the QA app service deployments * updating the name of the QA AZ creds secret and migrating the disabled prod deploy jobs to use the prod AZ secrets * adding in the additional key vault secrets and fixing some other mistakes * fixing one of the other preview versions * removing newline for testing commit * fixing typo * fixing a secret name typo * moving the secrets to the env to test their outputs * adding missing k * Update build workflow with environment variables for Docker Trust * removing the unneeded env vars * Update build and release workflow using Azure secrets as env variables * Clean up output of NuGet version * Fix capitalization * Fix variable names for Docker Trust Setup * fixing the dashes in the env ids * switching the dev tag for qa when pushing * commenting out the test for the pipeline testing * removing all of the testing code and blockers Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2021-05-04 22:41:49 +02:00
steps:
- name: Set up dotnet
uses: actions/setup-dotnet@9211491ffb35dd6a6657ca4f45d43dfe6e97c829
Automating Server Release/Deploy for QA Env (#1281) * initial success caching test * updating status testing * fixing the fail check * fixing bash if syntax * changing the way of testing since you can't change workflow inputs between re-runs * trying out different bash syntax * removing the export to env * adding in last run status check * switching up the last_run_status file handling since it doesn't look like it is working correctly * adding push trigger * fixing typo * adding date to the cache key and adding a bit more logging * fixing restore key * trying a different way of logging both successes and failures * fixing typo * reorganizing the random success/fail * trying different bash * fixing binary operator * adding in success flag checks * increasing the odds of success * trying to fix weird problem * changing dquotes to squotes * testing failure and always() flow * adding in a release pipeline * adding in the manual trigger for the release pipeline * fixing the bash for loop for tagging and switching to the rc image for release * adding docker trust to the pull task * fixing bash array typo * removing build task * adding the dotnet tool restore back in to hopefully restore swagger * adding an Api build to build the swagger docs * working on build workflow * testing cache between jobs * Adding in steps * fixing the last line * updating the build workflow * adding manual trigger for build workflow * moving the matrix values to the env section of the task * changing the envs * using env template replacement * removing the unique id since I don't think I need it * testing the cache * commenting out the docker push * adding the env vars back to the cache task * adding envs to test * fixing the path issue * resetting the build workflow back to serial build/docker * Adding in the qa release workflow * removing unneccessary dependency * parameterizing the project file names * forcing gulp install * installing gulp globally * reorganizing to see if gulp works * removing the awkward paths * fixing typo * commenting out all non-api matrix for easier testing * trying to zip the build for deploy * adding in the base path for the test * replacing the web app name * adding a specific slotname * adding the env into the package path for the deployment * trying to fix the zip * setting up all of the other deploys * switching the secrets over to be environment secrets * adding in production automation with the deploys commented out * removing the master branch from the QA deploy * adding in the dependancy on the setup * changing the tag * trying a different ref * renaming the deployment slot to staging * trying a different slot name * resetting the qa deploy to the original * moving the secrets * updating the qa deploy with the db reset/update stubs * updating the deploy task dependencies * adding missing update-db command placeholder * trying a string for the inputs * moving the input check into the steps instead of the job level so that the job completes * testing azure kv * fixing typo * Change id to retrieve-secrets * Fix typo * testing the rest of the QA app service deployments * updating the name of the QA AZ creds secret and migrating the disabled prod deploy jobs to use the prod AZ secrets * adding in the additional key vault secrets and fixing some other mistakes * fixing one of the other preview versions * removing newline for testing commit * fixing typo * fixing a secret name typo * moving the secrets to the env to test their outputs * adding missing k * Update build workflow with environment variables for Docker Trust * removing the unneeded env vars * Update build and release workflow using Azure secrets as env variables * Clean up output of NuGet version * Fix capitalization * Fix variable names for Docker Trust Setup * fixing the dashes in the env ids * switching the dev tag for qa when pushing * commenting out the test for the pipeline testing * removing all of the testing code and blockers Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2021-05-04 22:41:49 +02:00
with:
dotnet-version: '6.0.x'
Automating Server Release/Deploy for QA Env (#1281) * initial success caching test * updating status testing * fixing the fail check * fixing bash if syntax * changing the way of testing since you can't change workflow inputs between re-runs * trying out different bash syntax * removing the export to env * adding in last run status check * switching up the last_run_status file handling since it doesn't look like it is working correctly * adding push trigger * fixing typo * adding date to the cache key and adding a bit more logging * fixing restore key * trying a different way of logging both successes and failures * fixing typo * reorganizing the random success/fail * trying different bash * fixing binary operator * adding in success flag checks * increasing the odds of success * trying to fix weird problem * changing dquotes to squotes * testing failure and always() flow * adding in a release pipeline * adding in the manual trigger for the release pipeline * fixing the bash for loop for tagging and switching to the rc image for release * adding docker trust to the pull task * fixing bash array typo * removing build task * adding the dotnet tool restore back in to hopefully restore swagger * adding an Api build to build the swagger docs * working on build workflow * testing cache between jobs * Adding in steps * fixing the last line * updating the build workflow * adding manual trigger for build workflow * moving the matrix values to the env section of the task * changing the envs * using env template replacement * removing the unique id since I don't think I need it * testing the cache * commenting out the docker push * adding the env vars back to the cache task * adding envs to test * fixing the path issue * resetting the build workflow back to serial build/docker * Adding in the qa release workflow * removing unneccessary dependency * parameterizing the project file names * forcing gulp install * installing gulp globally * reorganizing to see if gulp works * removing the awkward paths * fixing typo * commenting out all non-api matrix for easier testing * trying to zip the build for deploy * adding in the base path for the test * replacing the web app name * adding a specific slotname * adding the env into the package path for the deployment * trying to fix the zip * setting up all of the other deploys * switching the secrets over to be environment secrets * adding in production automation with the deploys commented out * removing the master branch from the QA deploy * adding in the dependancy on the setup * changing the tag * trying a different ref * renaming the deployment slot to staging * trying a different slot name * resetting the qa deploy to the original * moving the secrets * updating the qa deploy with the db reset/update stubs * updating the deploy task dependencies * adding missing update-db command placeholder * trying a string for the inputs * moving the input check into the steps instead of the job level so that the job completes * testing azure kv * fixing typo * Change id to retrieve-secrets * Fix typo * testing the rest of the QA app service deployments * updating the name of the QA AZ creds secret and migrating the disabled prod deploy jobs to use the prod AZ secrets * adding in the additional key vault secrets and fixing some other mistakes * fixing one of the other preview versions * removing newline for testing commit * fixing typo * fixing a secret name typo * moving the secrets to the env to test their outputs * adding missing k * Update build workflow with environment variables for Docker Trust * removing the unneeded env vars * Update build and release workflow using Azure secrets as env variables * Clean up output of NuGet version * Fix capitalization * Fix variable names for Docker Trust Setup * fixing the dashes in the env ids * switching the dev tag for qa when pushing * commenting out the test for the pipeline testing * removing all of the testing code and blockers Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2021-05-04 22:41:49 +02:00
- name: Set up MSBuild
uses: microsoft/setup-msbuild@ab534842b4bdf384b8aaf93765dc6f721d9f5fab
Automating Server Release/Deploy for QA Env (#1281) * initial success caching test * updating status testing * fixing the fail check * fixing bash if syntax * changing the way of testing since you can't change workflow inputs between re-runs * trying out different bash syntax * removing the export to env * adding in last run status check * switching up the last_run_status file handling since it doesn't look like it is working correctly * adding push trigger * fixing typo * adding date to the cache key and adding a bit more logging * fixing restore key * trying a different way of logging both successes and failures * fixing typo * reorganizing the random success/fail * trying different bash * fixing binary operator * adding in success flag checks * increasing the odds of success * trying to fix weird problem * changing dquotes to squotes * testing failure and always() flow * adding in a release pipeline * adding in the manual trigger for the release pipeline * fixing the bash for loop for tagging and switching to the rc image for release * adding docker trust to the pull task * fixing bash array typo * removing build task * adding the dotnet tool restore back in to hopefully restore swagger * adding an Api build to build the swagger docs * working on build workflow * testing cache between jobs * Adding in steps * fixing the last line * updating the build workflow * adding manual trigger for build workflow * moving the matrix values to the env section of the task * changing the envs * using env template replacement * removing the unique id since I don't think I need it * testing the cache * commenting out the docker push * adding the env vars back to the cache task * adding envs to test * fixing the path issue * resetting the build workflow back to serial build/docker * Adding in the qa release workflow * removing unneccessary dependency * parameterizing the project file names * forcing gulp install * installing gulp globally * reorganizing to see if gulp works * removing the awkward paths * fixing typo * commenting out all non-api matrix for easier testing * trying to zip the build for deploy * adding in the base path for the test * replacing the web app name * adding a specific slotname * adding the env into the package path for the deployment * trying to fix the zip * setting up all of the other deploys * switching the secrets over to be environment secrets * adding in production automation with the deploys commented out * removing the master branch from the QA deploy * adding in the dependancy on the setup * changing the tag * trying a different ref * renaming the deployment slot to staging * trying a different slot name * resetting the qa deploy to the original * moving the secrets * updating the qa deploy with the db reset/update stubs * updating the deploy task dependencies * adding missing update-db command placeholder * trying a string for the inputs * moving the input check into the steps instead of the job level so that the job completes * testing azure kv * fixing typo * Change id to retrieve-secrets * Fix typo * testing the rest of the QA app service deployments * updating the name of the QA AZ creds secret and migrating the disabled prod deploy jobs to use the prod AZ secrets * adding in the additional key vault secrets and fixing some other mistakes * fixing one of the other preview versions * removing newline for testing commit * fixing typo * fixing a secret name typo * moving the secrets to the env to test their outputs * adding missing k * Update build workflow with environment variables for Docker Trust * removing the unneeded env vars * Update build and release workflow using Azure secrets as env variables * Clean up output of NuGet version * Fix capitalization * Fix variable names for Docker Trust Setup * fixing the dashes in the env ids * switching the dev tag for qa when pushing * commenting out the test for the pipeline testing * removing all of the testing code and blockers Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2021-05-04 22:41:49 +02:00
- name: Print environment
run: |
dotnet --info
msbuild -version
nuget help | grep Version
echo "GitHub ref: $GITHUB_REF"
echo "GitHub event: $GITHUB_EVENT"
Automating Server Release/Deploy for QA Env (#1281) * initial success caching test * updating status testing * fixing the fail check * fixing bash if syntax * changing the way of testing since you can't change workflow inputs between re-runs * trying out different bash syntax * removing the export to env * adding in last run status check * switching up the last_run_status file handling since it doesn't look like it is working correctly * adding push trigger * fixing typo * adding date to the cache key and adding a bit more logging * fixing restore key * trying a different way of logging both successes and failures * fixing typo * reorganizing the random success/fail * trying different bash * fixing binary operator * adding in success flag checks * increasing the odds of success * trying to fix weird problem * changing dquotes to squotes * testing failure and always() flow * adding in a release pipeline * adding in the manual trigger for the release pipeline * fixing the bash for loop for tagging and switching to the rc image for release * adding docker trust to the pull task * fixing bash array typo * removing build task * adding the dotnet tool restore back in to hopefully restore swagger * adding an Api build to build the swagger docs * working on build workflow * testing cache between jobs * Adding in steps * fixing the last line * updating the build workflow * adding manual trigger for build workflow * moving the matrix values to the env section of the task * changing the envs * using env template replacement * removing the unique id since I don't think I need it * testing the cache * commenting out the docker push * adding the env vars back to the cache task * adding envs to test * fixing the path issue * resetting the build workflow back to serial build/docker * Adding in the qa release workflow * removing unneccessary dependency * parameterizing the project file names * forcing gulp install * installing gulp globally * reorganizing to see if gulp works * removing the awkward paths * fixing typo * commenting out all non-api matrix for easier testing * trying to zip the build for deploy * adding in the base path for the test * replacing the web app name * adding a specific slotname * adding the env into the package path for the deployment * trying to fix the zip * setting up all of the other deploys * switching the secrets over to be environment secrets * adding in production automation with the deploys commented out * removing the master branch from the QA deploy * adding in the dependancy on the setup * changing the tag * trying a different ref * renaming the deployment slot to staging * trying a different slot name * resetting the qa deploy to the original * moving the secrets * updating the qa deploy with the db reset/update stubs * updating the deploy task dependencies * adding missing update-db command placeholder * trying a string for the inputs * moving the input check into the steps instead of the job level so that the job completes * testing azure kv * fixing typo * Change id to retrieve-secrets * Fix typo * testing the rest of the QA app service deployments * updating the name of the QA AZ creds secret and migrating the disabled prod deploy jobs to use the prod AZ secrets * adding in the additional key vault secrets and fixing some other mistakes * fixing one of the other preview versions * removing newline for testing commit * fixing typo * fixing a secret name typo * moving the secrets to the env to test their outputs * adding missing k * Update build workflow with environment variables for Docker Trust * removing the unneeded env vars * Update build and release workflow using Azure secrets as env variables * Clean up output of NuGet version * Fix capitalization * Fix variable names for Docker Trust Setup * fixing the dashes in the env ids * switching the dev tag for qa when pushing * commenting out the test for the pipeline testing * removing all of the testing code and blockers Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2021-05-04 22:41:49 +02:00
- name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
2022-02-10 15:40:31 +01:00
Automating Server Release/Deploy for QA Env (#1281) * initial success caching test * updating status testing * fixing the fail check * fixing bash if syntax * changing the way of testing since you can't change workflow inputs between re-runs * trying out different bash syntax * removing the export to env * adding in last run status check * switching up the last_run_status file handling since it doesn't look like it is working correctly * adding push trigger * fixing typo * adding date to the cache key and adding a bit more logging * fixing restore key * trying a different way of logging both successes and failures * fixing typo * reorganizing the random success/fail * trying different bash * fixing binary operator * adding in success flag checks * increasing the odds of success * trying to fix weird problem * changing dquotes to squotes * testing failure and always() flow * adding in a release pipeline * adding in the manual trigger for the release pipeline * fixing the bash for loop for tagging and switching to the rc image for release * adding docker trust to the pull task * fixing bash array typo * removing build task * adding the dotnet tool restore back in to hopefully restore swagger * adding an Api build to build the swagger docs * working on build workflow * testing cache between jobs * Adding in steps * fixing the last line * updating the build workflow * adding manual trigger for build workflow * moving the matrix values to the env section of the task * changing the envs * using env template replacement * removing the unique id since I don't think I need it * testing the cache * commenting out the docker push * adding the env vars back to the cache task * adding envs to test * fixing the path issue * resetting the build workflow back to serial build/docker * Adding in the qa release workflow * removing unneccessary dependency * parameterizing the project file names * forcing gulp install * installing gulp globally * reorganizing to see if gulp works * removing the awkward paths * fixing typo * commenting out all non-api matrix for easier testing * trying to zip the build for deploy * adding in the base path for the test * replacing the web app name * adding a specific slotname * adding the env into the package path for the deployment * trying to fix the zip * setting up all of the other deploys * switching the secrets over to be environment secrets * adding in production automation with the deploys commented out * removing the master branch from the QA deploy * adding in the dependancy on the setup * changing the tag * trying a different ref * renaming the deployment slot to staging * trying a different slot name * resetting the qa deploy to the original * moving the secrets * updating the qa deploy with the db reset/update stubs * updating the deploy task dependencies * adding missing update-db command placeholder * trying a string for the inputs * moving the input check into the steps instead of the job level so that the job completes * testing azure kv * fixing typo * Change id to retrieve-secrets * Fix typo * testing the rest of the QA app service deployments * updating the name of the QA AZ creds secret and migrating the disabled prod deploy jobs to use the prod AZ secrets * adding in the additional key vault secrets and fixing some other mistakes * fixing one of the other preview versions * removing newline for testing commit * fixing typo * fixing a secret name typo * moving the secrets to the env to test their outputs * adding missing k * Update build workflow with environment variables for Docker Trust * removing the unneeded env vars * Update build and release workflow using Azure secrets as env variables * Clean up output of NuGet version * Fix capitalization * Fix variable names for Docker Trust Setup * fixing the dashes in the env ids * switching the dev tag for qa when pushing * commenting out the test for the pipeline testing * removing all of the testing code and blockers Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2021-05-04 22:41:49 +02:00
- name: Restore
run: dotnet restore --locked-mode
Automating Server Release/Deploy for QA Env (#1281) * initial success caching test * updating status testing * fixing the fail check * fixing bash if syntax * changing the way of testing since you can't change workflow inputs between re-runs * trying out different bash syntax * removing the export to env * adding in last run status check * switching up the last_run_status file handling since it doesn't look like it is working correctly * adding push trigger * fixing typo * adding date to the cache key and adding a bit more logging * fixing restore key * trying a different way of logging both successes and failures * fixing typo * reorganizing the random success/fail * trying different bash * fixing binary operator * adding in success flag checks * increasing the odds of success * trying to fix weird problem * changing dquotes to squotes * testing failure and always() flow * adding in a release pipeline * adding in the manual trigger for the release pipeline * fixing the bash for loop for tagging and switching to the rc image for release * adding docker trust to the pull task * fixing bash array typo * removing build task * adding the dotnet tool restore back in to hopefully restore swagger * adding an Api build to build the swagger docs * working on build workflow * testing cache between jobs * Adding in steps * fixing the last line * updating the build workflow * adding manual trigger for build workflow * moving the matrix values to the env section of the task * changing the envs * using env template replacement * removing the unique id since I don't think I need it * testing the cache * commenting out the docker push * adding the env vars back to the cache task * adding envs to test * fixing the path issue * resetting the build workflow back to serial build/docker * Adding in the qa release workflow * removing unneccessary dependency * parameterizing the project file names * forcing gulp install * installing gulp globally * reorganizing to see if gulp works * removing the awkward paths * fixing typo * commenting out all non-api matrix for easier testing * trying to zip the build for deploy * adding in the base path for the test * replacing the web app name * adding a specific slotname * adding the env into the package path for the deployment * trying to fix the zip * setting up all of the other deploys * switching the secrets over to be environment secrets * adding in production automation with the deploys commented out * removing the master branch from the QA deploy * adding in the dependancy on the setup * changing the tag * trying a different ref * renaming the deployment slot to staging * trying a different slot name * resetting the qa deploy to the original * moving the secrets * updating the qa deploy with the db reset/update stubs * updating the deploy task dependencies * adding missing update-db command placeholder * trying a string for the inputs * moving the input check into the steps instead of the job level so that the job completes * testing azure kv * fixing typo * Change id to retrieve-secrets * Fix typo * testing the rest of the QA app service deployments * updating the name of the QA AZ creds secret and migrating the disabled prod deploy jobs to use the prod AZ secrets * adding in the additional key vault secrets and fixing some other mistakes * fixing one of the other preview versions * removing newline for testing commit * fixing typo * fixing a secret name typo * moving the secrets to the env to test their outputs * adding missing k * Update build workflow with environment variables for Docker Trust * removing the unneeded env vars * Update build and release workflow using Azure secrets as env variables * Clean up output of NuGet version * Fix capitalization * Fix variable names for Docker Trust Setup * fixing the dashes in the env ids * switching the dev tag for qa when pushing * commenting out the test for the pipeline testing * removing all of the testing code and blockers Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2021-05-04 22:41:49 +02:00
shell: pwsh
- name: Build solution
run: msbuild bitwarden-server.sln /p:Configuration=Debug /verbosity:minimal
shell: pwsh
2021-12-16 17:47:01 +01:00
- name: Test OSS solution
run: dotnet test ./test --configuration Debug --no-build
shell: pwsh
- name: Test Bitwarden solution
run: dotnet test ./bitwarden_license/test/CmmCore.Test --configuration Debug --no-build
Automating Server Release/Deploy for QA Env (#1281) * initial success caching test * updating status testing * fixing the fail check * fixing bash if syntax * changing the way of testing since you can't change workflow inputs between re-runs * trying out different bash syntax * removing the export to env * adding in last run status check * switching up the last_run_status file handling since it doesn't look like it is working correctly * adding push trigger * fixing typo * adding date to the cache key and adding a bit more logging * fixing restore key * trying a different way of logging both successes and failures * fixing typo * reorganizing the random success/fail * trying different bash * fixing binary operator * adding in success flag checks * increasing the odds of success * trying to fix weird problem * changing dquotes to squotes * testing failure and always() flow * adding in a release pipeline * adding in the manual trigger for the release pipeline * fixing the bash for loop for tagging and switching to the rc image for release * adding docker trust to the pull task * fixing bash array typo * removing build task * adding the dotnet tool restore back in to hopefully restore swagger * adding an Api build to build the swagger docs * working on build workflow * testing cache between jobs * Adding in steps * fixing the last line * updating the build workflow * adding manual trigger for build workflow * moving the matrix values to the env section of the task * changing the envs * using env template replacement * removing the unique id since I don't think I need it * testing the cache * commenting out the docker push * adding the env vars back to the cache task * adding envs to test * fixing the path issue * resetting the build workflow back to serial build/docker * Adding in the qa release workflow * removing unneccessary dependency * parameterizing the project file names * forcing gulp install * installing gulp globally * reorganizing to see if gulp works * removing the awkward paths * fixing typo * commenting out all non-api matrix for easier testing * trying to zip the build for deploy * adding in the base path for the test * replacing the web app name * adding a specific slotname * adding the env into the package path for the deployment * trying to fix the zip * setting up all of the other deploys * switching the secrets over to be environment secrets * adding in production automation with the deploys commented out * removing the master branch from the QA deploy * adding in the dependancy on the setup * changing the tag * trying a different ref * renaming the deployment slot to staging * trying a different slot name * resetting the qa deploy to the original * moving the secrets * updating the qa deploy with the db reset/update stubs * updating the deploy task dependencies * adding missing update-db command placeholder * trying a string for the inputs * moving the input check into the steps instead of the job level so that the job completes * testing azure kv * fixing typo * Change id to retrieve-secrets * Fix typo * testing the rest of the QA app service deployments * updating the name of the QA AZ creds secret and migrating the disabled prod deploy jobs to use the prod AZ secrets * adding in the additional key vault secrets and fixing some other mistakes * fixing one of the other preview versions * removing newline for testing commit * fixing typo * fixing a secret name typo * moving the secrets to the env to test their outputs * adding missing k * Update build workflow with environment variables for Docker Trust * removing the unneeded env vars * Update build and release workflow using Azure secrets as env variables * Clean up output of NuGet version * Fix capitalization * Fix variable names for Docker Trust Setup * fixing the dashes in the env ids * switching the dev tag for qa when pushing * commenting out the test for the pipeline testing * removing all of the testing code and blockers Co-authored-by: Vince Grassia <593223+vgrassia@users.noreply.github.com>
2021-05-04 22:41:49 +02:00
shell: pwsh
2020-07-17 16:51:32 +02:00
build-artifacts:
name: Build artifacts
runs-on: ubuntu-20.04
needs:
- testing
- lint
strategy:
fail-fast: false
matrix:
include:
- service_name: Admin
base_path: ./src
2022-03-03 23:53:09 +01:00
node: true
- service_name: Api
base_path: ./src
- service_name: Billing
base_path: ./src
- service_name: Events
base_path: ./src
- service_name: EventsProcessor
base_path: ./src
- service_name: Icons
base_path: ./src
- service_name: Identity
base_path: ./src
- service_name: Notifications
base_path: ./src
- service_name: Server
base_path: ./util
- service_name: Setup
base_path: ./util
- service_name: Sso
base_path: ./bitwarden_license/src
2022-03-03 23:53:09 +01:00
node: true
- service_name: Scim
base_path: ./bitwarden_license/src
dotnet: true
steps:
- name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- name: Set up Node
2022-03-15 19:56:50 +01:00
uses: actions/setup-node@9ced9a43a244f3ac94f13bfd896db8c8f30da67a # v3.0.0
with:
2022-03-15 19:56:50 +01:00
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
2022-03-03 23:53:09 +01:00
node-version: '16'
- name: Print environment
run: |
whoami
dotnet --info
node --version
npm --version
echo "GitHub ref: $GITHUB_REF"
echo "GitHub event: $GITHUB_EVENT"
- name: Restore/Clean service
working-directory: ${{ matrix.base_path }}/${{ matrix.service_name }}
run: |
echo "Restore"
dotnet restore
echo "Clean"
dotnet clean -c "Release" -o obj/build-output/publish
2022-03-03 23:53:09 +01:00
- name: Build node
if: ${{ matrix.node }}
working-directory: ${{ matrix.base_path }}/${{ matrix.service_name }}
run: |
2022-03-03 23:53:09 +01:00
npm ci
npm run build
- name: Publish service
working-directory: ${{ matrix.base_path }}/${{ matrix.service_name }}
run: |
echo "Publish"
dotnet publish -c "Release" -o obj/build-output/publish
cd obj/build-output/publish
zip -r ${{ matrix.service_name }}.zip .
mv ${{ matrix.service_name }}.zip ../../../
pwd
ls -atlh ../../../
- name: Upload service artifact
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
with:
name: ${{ matrix.service_name }}.zip
path: ${{ matrix.base_path }}/${{ matrix.service_name }}/${{ matrix.service_name }}.zip
if-no-files-found: error
build-docker:
name: Build Docker images
runs-on: ubuntu-20.04
needs: build-artifacts
strategy:
fail-fast: false
matrix:
include:
- service_name: Admin
base_path: ./src
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
dotnet: true
- service_name: Api
base_path: ./src
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
dotnet: true
- service_name: Attachments
base_path: ./util
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
- service_name: Events
base_path: ./src
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
dotnet: true
- service_name: EventsProcessor
base_path: ./src
docker_repos: [bitwardenqa.azurecr.io]
dotnet: true
- service_name: Icons
base_path: ./src
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
dotnet: true
- service_name: Identity
base_path: ./src
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
dotnet: true
- service_name: K8S-Proxy
base_path: ./util
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
- service_name: MsSql
base_path: ./util
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
- service_name: Nginx
base_path: ./util
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
- service_name: Notifications
base_path: ./src
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
dotnet: true
- service_name: Server
base_path: ./util
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
dotnet: true
- service_name: Setup
base_path: ./util
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
dotnet: true
- service_name: Sso
base_path: ./bitwarden_license/src
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
dotnet: true
- service_name: Scim
base_path: ./bitwarden_license/src
docker_repos: [bitwarden, bitwardenqa.azurecr.io]
dotnet: true
skip_dct: true
2020-07-17 16:51:32 +02:00
steps:
- name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
########## Build Docker Image ##########
- 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: Get build artifact
if: ${{ matrix.dotnet }}
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741
with:
name: ${{ matrix.service_name }}.zip
- name: Setup build artifact
if: ${{ matrix.dotnet }}
run: |
mkdir -p ${{ matrix.base_path}}/${{ matrix.service_name }}/obj/build-output/publish
unzip ${{ matrix.service_name }}.zip \
-d ${{ matrix.base_path }}/${{ matrix.service_name }}/obj/build-output/publish
2020-07-17 16:51:32 +02:00
- name: Build Docker images
run: |
if [ "${{ matrix.service_name }}" = "K8S-Proxy" ]; then
docker build -f ${{ matrix.base_path }}/Nginx/Dockerfile-k8s \
-t ${{ steps.setup.outputs.service_name }} ${{ matrix.base_path }}/Nginx
else
docker build -t ${{ steps.setup.outputs.service_name }} \
${{ matrix.base_path }}/${{ matrix.service_name }}
fi
########## ACR ##########
- name: Login to Azure - QA Subscription
uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf
with:
creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }}
- name: Login to Azure ACR
run: az acr login -n bitwardenqa
- name: Tag and Push RC to Azure ACR QA registry
env:
REGISTRY: bitwardenqa.azurecr.io
run: |
IMAGE_TAG=$(echo "${GITHUB_REF:11}" | sed "s#/#-#g") # slash safe branch name
if [[ "$IMAGE_TAG" == "master" ]]; then
IMAGE_TAG=dev
fi
docker tag ${{ steps.setup.outputs.service_name }} \
$REGISTRY/${{ steps.setup.outputs.service_name }}:$IMAGE_TAG
docker push $REGISTRY/${{ steps.setup.outputs.service_name }}:$IMAGE_TAG
- name: Log out of Docker
run: docker logout
########## DockerHub ##########
- name: Login to Azure - Prod Subscription
if: |
contains(matrix.docker_repos, 'bitwarden')
&& (github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/rc' ||
github.ref == 'refs/heads/hotfix-rc')
uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf
with:
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
- name: Retrieve secrets
if: |
contains(matrix.docker_repos, 'bitwarden')
&& (github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/rc' ||
github.ref == 'refs/heads/hotfix-rc')
id: retrieve-secrets
uses: Azure/get-keyvault-secrets@b5c723b9ac7870c022b8c35befe620b7009b336f
with:
keyvault: "bitwarden-prod-kv"
secrets: "docker-password,
docker-username,
dct-delegate-2-repo-passphrase,
dct-delegate-2-key"
- name: Log into Docker
if: |
contains(matrix.docker_repos, 'bitwarden')
&& (github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/rc' ||
github.ref == 'refs/heads/hotfix-rc')
env:
DOCKER_USERNAME: ${{ steps.retrieve-secrets.outputs.docker-username }}
DOCKER_PASSWORD: ${{ steps.retrieve-secrets.outputs.docker-password }}
run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- name: Setup Docker Trust
if: |
contains(matrix.docker_repos, 'bitwarden')
&& (github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/rc' ||
github.ref == 'refs/heads/hotfix-rc')
&& (!matrix.skip_dct)
env:
DCT_DELEGATION_KEY_ID: "c9bde8ec820701516491e5e03d3a6354e7bd66d05fa3df2b0062f68b116dc59c"
DCT_DELEGATE_KEY: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-key }}
DCT_REPO_PASSPHRASE: ${{ steps.retrieve-secrets.outputs.dct-delegate-2-repo-passphrase }}
run: |
mkdir -p ~/.docker/trust/private
echo "$DCT_DELEGATE_KEY" > ~/.docker/trust/private/$DCT_DELEGATION_KEY_ID.key
echo "DOCKER_CONTENT_TRUST=1" >> $GITHUB_ENV
echo "DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE=$DCT_REPO_PASSPHRASE" >> $GITHUB_ENV
- name: Tag and Push RC to Docker Hub
if: |
contains(matrix.docker_repos, 'bitwarden')
&& (github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/rc' ||
github.ref == 'refs/heads/hotfix-rc')
env:
REGISTRY: bitwarden
run: |
IMAGE_TAG=$(echo "${GITHUB_REF:11}" | sed "s#/#-#g") # slash safe branch name
if [[ "$IMAGE_TAG" == "master" ]]; then
IMAGE_TAG=dev
fi
docker tag ${{ steps.setup.outputs.service_name }} \
$REGISTRY/${{ steps.setup.outputs.service_name }}:$IMAGE_TAG
docker push $REGISTRY/${{ steps.setup.outputs.service_name }}:$IMAGE_TAG
- name: Log out of Docker and disable Docker Notary
if: |
contains(matrix.docker_repos, 'bitwarden')
&& (github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/rc' ||
github.ref == 'refs/heads/hotfix-rc')
run: |
docker logout
echo "DOCKER_CONTENT_TRUST=0" >> $GITHUB_ENV
upload:
name: Upload
runs-on: ubuntu-20.04
needs: build-docker
steps:
- name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- name: Restore
run: dotnet tool restore
- name: Make Docker stub
if: github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/rc' ||
github.ref == 'refs/heads/hotfix-rc'
2020-07-17 16:51:32 +02:00
run: |
if [[ "${{ github.ref }}" == "rc" ]]; then
SETUP_IMAGE="bitwarden/setup:rc"
elif [[ "${{ github.ref }}" == "hotfix-rc" ]]; then
SETUP_IMAGE="bitwarden/setup:hotfix-rc"
else
SETUP_IMAGE="bitwarden/setup:dev"
fi
2020-07-17 16:51:32 +02:00
STUB_OUTPUT=$(pwd)/docker-stub
docker run -i --rm --name setup -v $STUB_OUTPUT:/bitwarden $SETUP_IMAGE \
2020-07-17 16:51:32 +02:00
dotnet Setup.dll -stub 1 -install 1 -domain bitwarden.example.com -os lin
2020-07-17 17:19:00 +02:00
sudo chown -R $(whoami):$(whoami) $STUB_OUTPUT
2020-07-17 16:51:32 +02:00
rm -rf $STUB_OUTPUT/letsencrypt
rm $STUB_OUTPUT/env/uid.env $STUB_OUTPUT/config.yml
touch $STUB_OUTPUT/env/uid.env
cd docker-stub; zip -r ../docker-stub.zip *; cd ..
2022-02-28 15:38:59 +01:00
- name: Make Docker stub checksum
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc'
run: sha256sum docker-stub.zip > docker-stub-sha256.txt
- name: Upload Docker stub artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc'
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
2020-07-17 16:51:32 +02:00
with:
name: docker-stub.zip
2022-02-28 15:38:59 +01:00
path: docker-stub.zip
if-no-files-found: error
- name: Upload Docker stub checksum artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc'
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
2022-02-28 15:38:59 +01:00
with:
name: docker-stub-sha256.txt
path: docker-stub-sha256.txt
if-no-files-found: error
2020-07-17 16:51:32 +02:00
- name: Build Swagger
2020-07-17 17:19:00 +02:00
run: |
cd ./src/Api
echo "Restore"
dotnet restore
echo "Clean"
dotnet clean -c "Release" -o obj/build-output/publish
echo "Publish"
dotnet publish -c "Release" -o obj/build-output/publish
dotnet swagger tofile --output ../../swagger.json --host https://api.bitwarden.com \
./obj/build-output/publish/Api.dll public
2020-07-17 17:19:00 +02:00
cd ../..
env:
ASPNETCORE_ENVIRONMENT: Production
swaggerGen: 'True'
2022-02-23 19:29:17 +01:00
DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX: 2
2020-07-17 17:19:00 +02:00
- name: Upload Swagger artifact
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
2020-07-17 17:19:00 +02:00
with:
name: swagger.json
2022-02-28 15:38:59 +01:00
path: swagger.json
if-no-files-found: error
2021-12-16 17:47:01 +01:00
check-failures:
name: Check for failures
if: always()
runs-on: ubuntu-20.04
needs:
- cloc
2022-03-14 14:31:03 +01:00
- lint
- testing
- build-artifacts
- build-docker
- upload
steps:
- name: Check if any job failed
if: |
github.ref == 'refs/heads/master'
|| github.ref == 'refs/heads/rc'
|| github.ref == 'refs/heads/hotfix-rc'
env:
CLOC_STATUS: ${{ needs.cloc.result }}
2022-03-14 14:31:03 +01:00
LINT_STATUS: ${{ needs.lint.result }}
TESTING_STATUS: ${{ needs.testing.result }}
BUILD_ARTIFACTS_STATUS: ${{ needs.build-artifacts.result }}
BUILD_DOCKER_STATUS: ${{ needs.build-docker.result }}
UPLOAD_STATUS: ${{ needs.upload.result }}
run: |
if [ "$CLOC_STATUS" = "failure" ]; then
exit 1
2022-03-14 14:31:03 +01:00
elif [ "$LINT_STATUS" = "failure" ]; then
exit 1
elif [ "$TESTING_STATUS" = "failure" ]; then
exit 1
elif [ "$BUILD_ARTIFACTS_STATUS" = "failure" ]; then
exit 1
elif [ "$BUILD_DOCKER_STATUS" = "failure" ]; then
exit 1
elif [ "$UPLOAD_STATUS" = "failure" ]; then
exit 1
fi
- name: Login to Azure - Prod Subscription
uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf
if: failure()
with:
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
- name: Retrieve secrets
id: retrieve-secrets
uses: Azure/get-keyvault-secrets@b5c723b9ac7870c022b8c35befe620b7009b336f
if: failure()
with:
keyvault: "bitwarden-prod-kv"
secrets: "devops-alerts-slack-webhook-url"
- name: Notify Slack on failure
uses: act10ns/slack@da3191ebe2e67f49b46880b4633f5591a96d1d33 # v1.2.2
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }}
with:
status: ${{ job.status }}