From 4ff540126b7c5d71d12c81f5ce53cbc4d2daabf7 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Tue, 16 Jan 2024 14:57:16 +0500 Subject: [PATCH 1/4] comment tests --- .gitea/workflows/deploy.yaml | 33 ++++++++++++++++++++++++++++++++ .gitea/workflows/unit-tests.yaml | 22 +++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml create mode 100644 .gitea/workflows/unit-tests.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 00000000..4963d3a9 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,33 @@ +name: deploy test server +run-name: ${{ gitea.actor }} is deploying to test server +on: + push: + branches: + - dev + +jobs: + deploy-test: + runs-on: ubuntu-latest + + steps: + - name: Setup dotnet + if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }} + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x + - name: Check out repository code + uses: actions/checkout@v4 + - name: Add gitea as nuget source + run: dotnet nuget add source --name gitea --username publisher --password ${{ secrets.PUBLISHER_PASSWORD }} --store-password-in-clear-text http://test.digitaldrilling.ru:8080/api/packages/DDrilling/nuget/index.json + #- run: dotnet test AsbCloudWebApi.Tests + - run: dotnet publish AsbCloudWebApi --os linux --sc true -o ./build + - name: Deploy to Test server via rsync + uses: burnett01/rsync-deployments@5.2.1 + with: + switches: -avzr --delete --exclude="files" --exclude="appsettings.json" + path: ./build/ + remote_path: /home/asb/AsbCloud/ + remote_host: test.digitaldrilling.ru + remote_user: asb + remote_port: 35222 + remote_key: ${{ secrets.SSH_PRIVATE_KEY }} \ No newline at end of file diff --git a/.gitea/workflows/unit-tests.yaml b/.gitea/workflows/unit-tests.yaml new file mode 100644 index 00000000..dbb278f1 --- /dev/null +++ b/.gitea/workflows/unit-tests.yaml @@ -0,0 +1,22 @@ +# name: Unit tests +# run-name: ${{ gitea.actor }} is testing +# on: +# pull_request: +# types: [review_requested, ready_for_review] + +# jobs: +# test: +# runs-on: ubuntu-latest + +# steps: +# - name: Setup dotnet +# if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }} +# uses: actions/setup-dotnet@v4 +# with: +# dotnet-version: 6.0.x +# - name: Check out repository code +# uses: actions/checkout@v4 +# - name: Add gitea as nuget source +# run: dotnet nuget add source --name gitea --username publisher --password ${{ secrets.PUBLISHER_PASSWORD }} --store-password-in-clear-text http://test.digitaldrilling.ru:8080/api/packages/DDrilling/nuget/index.json +# - run: dotnet test AsbCloudWebApi.Tests + \ No newline at end of file From d67a22b2f182c09836ccf02409da3ea5152cecc4 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Tue, 16 Jan 2024 14:59:01 +0500 Subject: [PATCH 2/4] workflow fix trigger --- .gitea/workflows/deploy.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 4963d3a9..67b43700 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -2,7 +2,8 @@ name: deploy test server run-name: ${{ gitea.actor }} is deploying to test server on: push: - branches: + branches: + - master - dev jobs: From 004ab09b81edbd3ec99130e3a9264ca651a1bd3d Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Tue, 16 Jan 2024 15:00:09 +0500 Subject: [PATCH 3/4] workflow fix spacing --- .gitea/workflows/deploy.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 67b43700..abffdb50 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -24,11 +24,11 @@ jobs: - run: dotnet publish AsbCloudWebApi --os linux --sc true -o ./build - name: Deploy to Test server via rsync uses: burnett01/rsync-deployments@5.2.1 - with: - switches: -avzr --delete --exclude="files" --exclude="appsettings.json" - path: ./build/ - remote_path: /home/asb/AsbCloud/ - remote_host: test.digitaldrilling.ru - remote_user: asb - remote_port: 35222 - remote_key: ${{ secrets.SSH_PRIVATE_KEY }} \ No newline at end of file + with: + switches: -avzr --delete --exclude="files" --exclude="appsettings.json" + path: ./build/ + remote_path: /home/asb/AsbCloud/ + remote_host: test.digitaldrilling.ru + remote_user: asb + remote_port: 35222 + remote_key: ${{ secrets.SSH_PRIVATE_KEY }} \ No newline at end of file From 22f2f3405968e8dd97ec3b4fe411ad6f742f9267 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Tue, 16 Jan 2024 15:12:52 +0500 Subject: [PATCH 4/4] workflow/ separate deploy to dev and prod --- .../{deploy.yaml => deploy-dev.yaml} | 5 +-- .gitea/workflows/deploy-prod.yaml | 43 +++++++++++++++++++ .gitea/workflows/unit-tests.yaml | 38 ++++++++-------- 3 files changed, 64 insertions(+), 22 deletions(-) rename .gitea/workflows/{deploy.yaml => deploy-dev.yaml} (93%) create mode 100644 .gitea/workflows/deploy-prod.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy-dev.yaml similarity index 93% rename from .gitea/workflows/deploy.yaml rename to .gitea/workflows/deploy-dev.yaml index abffdb50..aab333d7 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy-dev.yaml @@ -2,8 +2,7 @@ name: deploy test server run-name: ${{ gitea.actor }} is deploying to test server on: push: - branches: - - master + branches: - dev jobs: @@ -20,7 +19,7 @@ jobs: uses: actions/checkout@v4 - name: Add gitea as nuget source run: dotnet nuget add source --name gitea --username publisher --password ${{ secrets.PUBLISHER_PASSWORD }} --store-password-in-clear-text http://test.digitaldrilling.ru:8080/api/packages/DDrilling/nuget/index.json - #- run: dotnet test AsbCloudWebApi.Tests + - run: dotnet test AsbCloudWebApi.Tests - run: dotnet publish AsbCloudWebApi --os linux --sc true -o ./build - name: Deploy to Test server via rsync uses: burnett01/rsync-deployments@5.2.1 diff --git a/.gitea/workflows/deploy-prod.yaml b/.gitea/workflows/deploy-prod.yaml new file mode 100644 index 00000000..a72f27b1 --- /dev/null +++ b/.gitea/workflows/deploy-prod.yaml @@ -0,0 +1,43 @@ +name: deploy test server +run-name: ${{ gitea.actor }} is deploying to test server +on: + push: + branches: + - master + +jobs: + deploy-prods: + runs-on: ubuntu-latest + + steps: + - name: Setup dotnet + if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }} + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x + - name: Check out repository code + uses: actions/checkout@v4 + - name: Add gitea as nuget source + run: dotnet nuget add source --name gitea --username publisher --password ${{ secrets.PUBLISHER_PASSWORD }} --store-password-in-clear-text http://test.digitaldrilling.ru:8080/api/packages/DDrilling/nuget/index.json + - run: dotnet test AsbCloudWebApi.Tests + - run: dotnet publish AsbCloudWebApi --os linux --sc true -o ./build + - name: Deploy to ASB server via rsync + uses: burnett01/rsync-deployments@5.2.1 + with: + switches: -avzr --delete --exclude="files" --exclude="appsettings.json" + path: ./build/ + remote_path: /home/dev/new_version/backend/ + remote_host: cloud.autodrilling.ru + remote_user: dev + remote_port: 6923 + remote_key: ${{ secrets.SSH_PRIVATE_KEY }} + - name: Deploy to DD server via rsync + uses: burnett01/rsync-deployments@5.2.1 + with: + switches: -avzr --delete --exclude="files" --exclude="appsettings.json" + path: ./build/ + remote_path: /home/asb/new_version/backend/ + remote_host: cloud.digitaldrilling.ru + remote_user: asb + remote_port: 22 + remote_key: ${{ secrets.SSH_PRIVATE_KEY }} \ No newline at end of file diff --git a/.gitea/workflows/unit-tests.yaml b/.gitea/workflows/unit-tests.yaml index dbb278f1..09711bfa 100644 --- a/.gitea/workflows/unit-tests.yaml +++ b/.gitea/workflows/unit-tests.yaml @@ -1,22 +1,22 @@ -# name: Unit tests -# run-name: ${{ gitea.actor }} is testing -# on: -# pull_request: -# types: [review_requested, ready_for_review] +name: Unit tests +run-name: ${{ gitea.actor }} is testing +on: + pull_request: + types: [review_requested, ready_for_review] -# jobs: -# test: -# runs-on: ubuntu-latest +jobs: + test: + runs-on: ubuntu-latest -# steps: -# - name: Setup dotnet -# if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }} -# uses: actions/setup-dotnet@v4 -# with: -# dotnet-version: 6.0.x -# - name: Check out repository code -# uses: actions/checkout@v4 -# - name: Add gitea as nuget source -# run: dotnet nuget add source --name gitea --username publisher --password ${{ secrets.PUBLISHER_PASSWORD }} --store-password-in-clear-text http://test.digitaldrilling.ru:8080/api/packages/DDrilling/nuget/index.json -# - run: dotnet test AsbCloudWebApi.Tests + steps: + - name: Setup dotnet + if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }} + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x + - name: Check out repository code + uses: actions/checkout@v4 + - name: Add gitea as nuget source + run: dotnet nuget add source --name gitea --username publisher --password ${{ secrets.PUBLISHER_PASSWORD }} --store-password-in-clear-text http://test.digitaldrilling.ru:8080/api/packages/DDrilling/nuget/index.json + - run: dotnet test AsbCloudWebApi.Tests \ No newline at end of file