diff --git a/.github/workflows/branchtest.yml b/.github/workflows/branchtest.yml index 56e5ae4..83b7860 100644 --- a/.github/workflows/branchtest.yml +++ b/.github/workflows/branchtest.yml @@ -18,6 +18,9 @@ on: server: type: string required: true + test-type: + required: true + type: string workflow_dispatch: inputs: tag: @@ -40,7 +43,14 @@ on: description: server hostname required: true default: "server" - + test-type: + description: digitalocean token + required: true + type: choice + options: + - devops + - branch + jobs: setadmin: @@ -55,6 +65,12 @@ jobs: name: remove all gateways runs-on: ubuntu-latest steps: + - name: set token + run: echo "TOKEN=${{ secrets.DO_TOKEN }}" >> $GITHUB_ENV + if: inputs.test-type == 'devops' + - name: set branch token + run: echo "TOKEN=${{ secrets.TESTING_DO_TOKEN }}" >> $GITHUB_ENV + if: inputs.test-type == 'branch' - name: get binary run: | mkdir bin @@ -65,7 +81,7 @@ jobs: chmod +x bin/test bin/test clean env: - DIGITALOCEAN_TOKEN: ${{ secrets.DO_TOKEN }} + DIGITALOCEAN_TOKEN: ${{ env.TOKEN }} KEY: ${{ secrets.TESTING_SSH_KEY }} TAG: ${{ inputs.tag }} NETWORK: ${{ inputs.network}} @@ -96,7 +112,7 @@ jobs: sleep 30 bin/test ping env: - DIGITALOCEAN_TOKEN: ${{ secrets.DO_TOKEN }} + DIGITALOCEAN_TOKEN: ${{ env.TOKEN }} KEY: ${{ secrets.TESTING_SSH_KEY }} TAG: ${{ inputs.tag }} NETWORK: ${{ inputs.network }} @@ -127,7 +143,7 @@ jobs: bin/test egress bin/test relay env: - DIGITALOCEAN_TOKEN: ${{ secrets.DO_TOKEN }} + DIGITALOCEAN_TOKEN: ${{ env.TOKEN }} KEY: ${{ secrets.TESTING_SSH_KEY }} TAG: ${{ inputs.tag }} NETWORK: ${{ inputs.network }} @@ -156,7 +172,7 @@ jobs: chmod +x bin/test bin/test ping env: - DIGITALOCEAN_TOKEN: ${{ secrets.DO_TOKEN }} + DIGITALOCEAN_TOKEN: ${{ env.TOKEN }} KEY: ${{ secrets.TESTING_SSH_KEY }} TAG: ${{ inputs.tag }} NETWORK: ${{ inputs.network }} diff --git a/.github/workflows/devops.yml b/.github/workflows/devops.yml index c82e6a7..f100985 100644 --- a/.github/workflows/devops.yml +++ b/.github/workflows/devops.yml @@ -44,5 +44,6 @@ jobs: api: "https://api.clustercat.com" masterkey: secretkey server: server + test-type: devops secrets: inherit diff --git a/.github/workflows/runall-tests.yml b/.github/workflows/runall-tests.yml index 57ab730..3f7e684 100644 --- a/.github/workflows/runall-tests.yml +++ b/.github/workflows/runall-tests.yml @@ -13,5 +13,6 @@ jobs: api: "https://api.clustercat.com" masterkey: "secretkey" server: "server" + test-type: devops secrets: inherit diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index f7b5b21..86a8959 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -101,7 +101,7 @@ jobs: terraform plan terraform apply -auto-approve env: - TF_VAR_do_token: "${{ secrets.DO_TOKEN }}" + TF_VAR_do_token: "${{ secrets.TESTING_DO_TOKEN }}" TF_VAR_pvt_key: "${{ secrets.TESTING_SSH_KEY }}" TF_VAR_branch: "${{ inputs.netmakerbranch }}" TF_VAR_clientbranch: "${{ inputs.netclientbranch }}" diff --git a/.github/workflows/test-artifacts.yml b/.github/workflows/test-artifacts.yml index 04c7710..6f6757f 100644 --- a/.github/workflows/test-artifacts.yml +++ b/.github/workflows/test-artifacts.yml @@ -216,4 +216,5 @@ jobs: SSH_KEY: ${{ secrets.TESTING_SSH_KEY }} - name: build linux package run: | - ssh root@fileserver.clustercat.com "cd packages; git restore .; git pull; export LC_VERSION=0.24.3; export LC_REVISION=${{ env.REVISION }}; ./apt_test_builder.sh; git restore ." + ssh root@fileserver.clustercat.com "cd packages; git restore .; git pull; export VERSION=0.25.0; export REVISION=${{ env.REVISION }}; ./apt_test_builder.sh; git restore ." + diff --git a/.github/workflows/testdeploybranch.yml b/.github/workflows/testdeploybranch.yml index 4082cb2..5097d65 100644 --- a/.github/workflows/testdeploybranch.yml +++ b/.github/workflows/testdeploybranch.yml @@ -76,7 +76,7 @@ jobs: terraform: needs: [getserver] - uses: gravitl/devops/.github/workflows/terraform.yml@master + uses: gravitl/devops/.github/workflows/terraform.yml@NET-1438 with: netclientbranch: ${{ inputs.netclientbranch }} netmakerbranch: ${{ inputs.netmakerbranch }} @@ -110,11 +110,12 @@ jobs: testbranch: needs: [getserver, terraform, masterkey] - uses: ./.github/workflows/branchtest.yml + uses: gravitl/devops/.github/workflows/branchtest.yml@NET-1438 with: tag: ${{ inputs.tag }} network: netmaker api: "https://api.${{ needs.getserver.outputs.server }}.clustercat.com" masterkey: ${{ needs.masterkey.outputs.masterkey }} server: ${{ needs.getserver.outputs.server }} + test-type: branch secrets: inherit