1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-12 13:19:01 -05:00

[DEVOPS-1215] Build migrator CLI project (#2747)

* Add migrator cli

* Ran format

* Acc build workflow

* Change paths in push and pr triggers

* Add build migrator cli to build workflow

* Remove build migrator cli workflow

* Add different levels of logs for verbose

* Rename migratorCLI to MsSqlMigratorUtility

* Add MsSqlMigratorUtility to solution file

* Remove the clean command

* Fix name and path in build workflow

* Add retry logic to DbMigrator instead of invocation

* Add migrator with retry mechanism as a new method

* Log the migration start log to migrate database method

* Fix name in build

* Fix cli leftovers

* Fix exception var name

* String interpolation

* Remove redundant check for number

* Remove CommandDotNet

* dotnet format

* Remove CommandDotNet from packages lock

* Remove all cli

* Trying to remove usings to see if this fixes linter

* Add usings back again - uild is failing

* Remove implicit usings

* Trying to fix linter issues

* Trying to fix linter
This commit is contained in:
Michał Chęciński
2023-03-06 15:39:30 +01:00
committed by GitHub
parent 27adaf59b4
commit 9cbf254fef
7 changed files with 2912 additions and 34 deletions

View File

@ -467,6 +467,58 @@ jobs:
path: swagger.json
if-no-files-found: error
build-mssqlmigratorutility:
name: Build MsSqlMigratorUtility
runs-on: ubuntu-22.04
needs:
- lint
defaults:
run:
shell: bash
working-directory: "util/MsSqlMigratorUtility"
strategy:
fail-fast: false
matrix:
target:
- osx-x64
- linux-x64
- win-x64
steps:
- name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
- name: Print environment
run: |
whoami
dotnet --info
echo "GitHub ref: $GITHUB_REF"
echo "GitHub event: $GITHUB_EVENT"
- name: Restore project
run: |
echo "Restore"
dotnet restore
- name: Publish project
run: dotnet publish -c "Release" -o obj/build-output/publish -r ${{ matrix.target }} --self-contained true
- name: Upload project artifact Windows
if: ${{ contains(matrix.target, 'win') == true }}
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
with:
name: MsSqlMigratorUtility-${{ matrix.target }}
path: util/MsSqlMigratorUtility/obj/build-output/publish/MsSqlMigratorUtility.exe
if-no-files-found: error
- name: Upload project artifact
if: ${{ contains(matrix.target, 'win') == false }}
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
with:
name: MsSqlMigratorUtility-${{ matrix.target }}
path: util/MsSqlMigratorUtility/obj/build-output/publish/MsSqlMigratorUtility
if-no-files-found: error
check-failures:
name: Check for failures
if: always()
@ -478,6 +530,7 @@ jobs:
- build-artifacts
- build-docker
- upload
- build-mssqlmigratorutility
steps:
- name: Check if any job failed
if: |
@ -491,6 +544,7 @@ jobs:
BUILD_ARTIFACTS_STATUS: ${{ needs.build-artifacts.result }}
BUILD_DOCKER_STATUS: ${{ needs.build-docker.result }}
UPLOAD_STATUS: ${{ needs.upload.result }}
BUILD_MSSQLMIGRATORUTILITY_STATUS: ${{ needs.build-mssqlmigratorutility.result }}
run: |
if [ "$CLOC_STATUS" = "failure" ]; then
exit 1
@ -504,6 +558,8 @@ jobs:
exit 1
elif [ "$UPLOAD_STATUS" = "failure" ]; then
exit 1
elif [ "$BUILD_MSSQLMIGRATORUTILITY_STATUS" = "failure" ]; then
exit 1
fi
- name: Login to Azure - Prod Subscription