Update ENV vars

This commit is contained in:
Abdul Rabbani 2022-04-18 16:42:20 -04:00
parent 4446219c36
commit 88e20dfc6e

View File

@ -14,10 +14,10 @@ jobs:
name: Run unit tests name: Run unit tests
env: env:
GOPATH: /tmp/go GOPATH: /tmp/go
HOSTNAME: ${{ secrets.BUILD_HOSTNAME }} BUILD_HOSTNAME: ${{ secrets.BUILD_HOSTNAME }}
USERNAME: ${{ secrets.BUILD_USERNAME }} BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }}
PRIVATE_KEY: ${{ secrets.BUILD_KEY }} BUILD_KEY: ${{ secrets.BUILD_KEY }}
PASSWORD: ${{ secrets.BUILD_PASSWORD}} BUILD_PASSWORD: ${{ secrets.BUILD_PASSWORD}}
strategy: strategy:
matrix: matrix:
go-version: [1.16.x, 1.17.x] go-version: [1.16.x, 1.17.x]
@ -33,32 +33,32 @@ jobs:
run: | run: |
echo ${{ env.GITHUB_REPOSITORY}} > /tmp/git_repository echo ${{ env.GITHUB_REPOSITORY}} > /tmp/git_repository
echo ${{ env.GITHUB_HEAD_REF}} > /tmp/git_head_ref echo ${{ env.GITHUB_HEAD_REF}} > /tmp/git_head_ref
# echo ${{ env.PRIVATE_KEY }} | tr '\n' ''| sshpass -p ${{ env.PASSWORD }} scp -i /dev/stdin /tmp/git_repository {{ env.USERNAME }}@${{ env.HOSTNAME }}:/tmp/git_repository # echo ${{ env.BUILD_KEY }} | tr '\n' ''| sshpass -p ${{ env.BUILD_PASSWORD }} scp -i /dev/stdin /tmp/git_repository {{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/git_repository
# echo ${{ env.PRIVATE_KEY }} | tr '\n' ''| sshpass -p ${{ env.PASSWORD }} scp -i /dev/stdin /tmp/git_head_ref {{ env.USERNAME }}@${{ env.HOSTNAME }}:/tmp/git_head_ref # echo ${{ env.BUILD_KEY }} | tr '\n' ''| sshpass -p ${{ env.BUILD_PASSWORD }} scp -i /dev/stdin /tmp/git_head_ref {{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/git_head_ref
# echo ${{ env.PRIVATE_KEY }} | tr '\n' ''| sshpass -p ${{ env.PASSWORD }} scp -i /dev/stdin ./github/workflows/run_unit_test.sh {{ env.USERNAME }}@${{ env.HOSTNAME }}:/tmp/run_unit_test.sh # echo ${{ env.BUILD_KEY }} | tr '\n' ''| sshpass -p ${{ env.BUILD_PASSWORD }} scp -i /dev/stdin ./github/workflows/run_unit_test.sh {{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/run_unit_test.sh
- name: SCP some files - name: SCP some files
uses: appleboy/scp-action@master uses: appleboy/scp-action@master
with: with:
host: ${{ env.HOSTNAME }} host: ${{ env.BUILD_HOSTNAME }}
username: ${{ env.USERNAME }} BUILD_USERNAME: ${{ env.BUILD_USERNAME }}
# passphrase: $ {{ env.PASSWORD }} # passphrase: $ {{ env.BUILD_PASSWORD }}
key: ${{ env.PRIVATE_KEY }} key: ${{ env.BUILD_KEY }}
port: 22 port: 22
source: "/tmp/git_repository,/tmp/git_head_ref,./github/workflows/run_unit_test.sh" source: "/tmp/git_repository,/tmp/git_head_ref,./github/workflows/run_unit_test.sh"
target: "/tmp/" target: "/tmp/"
- name: Trigger Unit Test - name: Trigger Unit Test
run: echo ${{ env.PRIVATE_KEY }} | sshpass -p ${{ env.PASSWORD }} ssh {{ env.USERNAME }}@{{ env.HOSTNAME }} -i /dev/stdin /tmp/run_unit_test.sh run: echo ${{ env.BUILD_KEY }} | sshpass -p ${{ env.BUILD_PASSWORD }} ssh {{ env.BUILD_USERNAME }}@{{ env.BUILD_HOSTNAME }} -i /dev/stdin /tmp/run_unit_test.sh
- name: Get the logs and cat them - name: Get the logs and cat them
run: | run: |
echo ${{ env.PRIVATE_KEY }} | sshpass -p ${{ env.PASSWORD }} scp -i /dev/stdin {{ env.USERNAME }}@${{ env.HOSTNAME }}:/tmp/test.log . echo ${{ env.BUILD_KEY }} | sshpass -p ${{ env.BUILD_PASSWORD }} scp -i /dev/stdin {{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/test.log .
cat ./test.log cat ./test.log
- name: Check Error Code - name: Check Error Code
run: | run: |
echo ${{ env.PRIVATE_KEY }} | sshpass -p ${{ env.PASSWORD }} scp -i /dev/stdin {{ env.USERNAME }}@${{ env.HOSTNAME }}:/tmp/return_test.txt . echo ${{ env.BUILD_KEY }} | sshpass -p ${{ env.BUILD_PASSWORD }} scp -i /dev/stdin {{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/return_test.txt .
[ $(cat ./return_test.txt) -eq 0 ] [ $(cat ./return_test.txt) -eq 0 ]
integrationtest: integrationtest: