Skip to content

Commit

Permalink
Extend the github action to run the emailer.test tool on the remote s…
Browse files Browse the repository at this point in the history
…erver

Extend the github action so that it:

creates a test_envs.sh file
copies test_envs.sh to the remote server

test_envs holds a copy of the env vars we want set on the remote server
for the test based on github secrets. Then

coppies the email.test to the remote server
sources the test_env.sh fiel on the remote server
executes the emailer.test tool
  • Loading branch information
owenwaller committed Feb 22, 2024
1 parent 1a9997c commit 5ebc0df
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/emailformgateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,28 @@ jobs:
- name: List public dir
run: ssh gophercoders.com 'whoami; ls -l ~/'

- name: Create env file
run: |
cat >> ./test_envs.sh <<END
export TEST_CUSTOMER_TO_EMAIL_ADDRESS=$TEST_CUSTOMER_TO_EMAIL_ADDRESS
export TEST_SYSTEM_TO_EMAIL_ADDRESS=$TEST_SYSTEM_TO_EMAIL_ADDRESS
export TEST_CONFIG_FILE=$TEST_CONFIG_FILE
END
env:
TEST_CUSTOMER_TO_EMAIL_ADDRESS: ${{ secrets.TEST_CUSTOMER_TO_EMAIL_ADDRESS }}
TEST_SYSTEM_TO_EMAIL_ADDRESS: ${{ secrets.TEST_SYSTEM_TO_EMAIL_ADDRESS }}
TEST_CONFIG_FILE: ${{ secrets.TEST_CONFIG_FILE }}

- name: Copy files to server
run: |
scp ./test_envs.sh ./emailer.test ./*.template /gophercoders-config.toml gophercoders.com:
- name: Run emailer.test test
run: |
ssh gophercoders.com -c "source ./test_envs.sh; TEST_TEMPLATES_DIR=$PWD TEST_DOMAIN=gophercoders.com ./emailer.test"
- name: Delete ssh dir
if: ${{ always() }}
run: |
rm -rf ~/.ssh
rm ./test_envs.sh

0 comments on commit 5ebc0df

Please sign in to comment.