|
@@ -39,73 +39,12 @@ jobs:
|
|
echo branch does not exist
|
|
echo branch does not exist
|
|
echo "netclientbranch=develop" >> $GITHUB_OUTPUT
|
|
echo "netclientbranch=develop" >> $GITHUB_OUTPUT
|
|
fi
|
|
fi
|
|
-
|
|
|
|
- getserver:
|
|
|
|
- runs-on: ubuntu-latest
|
|
|
|
- needs: skip-check
|
|
|
|
- if: ${{ needs.skip-check.outputs.skip != 'true' }}
|
|
|
|
- outputs:
|
|
|
|
- netmakerserver: ${{ steps.getserver.outputs.server }}
|
|
|
|
- steps:
|
|
|
|
- - name: setup ssh
|
|
|
|
- run: |
|
|
|
|
- mkdir -p ~/.ssh/
|
|
|
|
- echo "$SSH_KEY" > ~/.ssh/id_devops
|
|
|
|
- chmod 600 ~/.ssh/id_devops
|
|
|
|
- cat >>~/.ssh/config <<END
|
|
|
|
- Host *.clustercat.com
|
|
|
|
- User root
|
|
|
|
- IdentityFile ~/.ssh/id_devops
|
|
|
|
- StrictHostKeyChecking no
|
|
|
|
- END
|
|
|
|
- env:
|
|
|
|
- SSH_KEY: ${{ secrets.TESTING_SSH_KEY }}
|
|
|
|
- - name: getserver
|
|
|
|
- id: getserver
|
|
|
|
- run: |
|
|
|
|
- server=""
|
|
|
|
- for arg in "branch1" "branch2" "branch3" "branch4" "branch5"; do
|
|
|
|
- echo checking $arg
|
|
|
|
- result=$( ssh root@server.${arg}.clustercat.com '~/branchtesting/check.sh')
|
|
|
|
- echo $result
|
|
|
|
- if [ "$result" == "pass" ]
|
|
|
|
- then
|
|
|
|
- server=$arg
|
|
|
|
|
|
|
|
- echo $server >> /tmp/server
|
|
|
|
-
|
|
|
|
- break
|
|
|
|
- fi
|
|
|
|
- done
|
|
|
|
- echo server is $server
|
|
|
|
- if [ "$server" == "" ]
|
|
|
|
- then
|
|
|
|
- echo server not set
|
|
|
|
- exit 1
|
|
|
|
- fi
|
|
|
|
- echo "netmakerserver=${ server }" >> $GITHUB_OUTPUT
|
|
|
|
- - name: save server name
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
- with:
|
|
|
|
- name: server
|
|
|
|
- path: /tmp/ping
|
|
|
|
- retention-days: 3
|
|
|
|
-
|
|
|
|
- terraform:
|
|
|
|
- needs: [getbranch, getserver]
|
|
|
|
- uses: gravitl/devops/.github/workflows/terraform.yml@master
|
|
|
|
|
|
+ branchtest:
|
|
|
|
+ uses: gravitl/devops/.github/workflows/testdeploybranch.yml@master
|
|
|
|
+ needs: [getbranch, skip-check]
|
|
with:
|
|
with:
|
|
- netmakerbranch: ${{ github.head_ref }}
|
|
|
|
netclientbranch: ${{ needs.getbranch.outputs.netclientbranch }}
|
|
netclientbranch: ${{ needs.getbranch.outputs.netclientbranch }}
|
|
- server: ${{ needs.getserver.outputs.netmakerserver }}
|
|
|
|
- secrets: inherit
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- testbranch:
|
|
|
|
- needs: [getbranch, terraform]
|
|
|
|
- uses: gravitl/devops/.github/workflows/branchtest.yml@master
|
|
|
|
- with:
|
|
|
|
|
|
+ netmakerbranch: ${{ github.head_ref }}
|
|
tag: ${{ github.run_id }}-${{ github.run_attempt }}
|
|
tag: ${{ github.run_id }}-${{ github.run_attempt }}
|
|
- network: netmaker
|
|
|
|
- secrets: inherit
|
|
|
|
-
|
|
|
|
|
|
+ secrets: inherit
|