ci: use correct repo and branch

fix tests to actually test the correct repository and branch
This commit is contained in:
4s3ti 2022-08-25 01:33:09 +02:00
parent e5b9486c52
commit 9485852c2c
No known key found for this signature in database
GPG key ID: AC2D3B898F96BC51
2 changed files with 37 additions and 9 deletions

View file

@ -52,12 +52,14 @@ jobs:
dist: bionic
virt: vm
arch: amd64
env:
- VPNPROTO=openvpn
before_script:
- sudo chmod +x ciscripts/*.sh
- ./ciscripts/pre_checks.sh
- ./ciscripts/startup.sh -o
script:
- sudo ./auto_install/install.sh --unattended ciscripts/ci_openvpn.conf
- ./ciscripts/test_install.sh
- ./ciscripts/test.sh -o
after_fail:
- sudo journalctl -xe
@ -67,12 +69,14 @@ jobs:
dist: bionic
virt: vm
arch: amd64
env:
- VPNPROTO=wireguard
before_script:
- sudo chmod +x ciscripts/*.sh
- ./ciscripts/pre_checks.sh
- ./ciscripts/startup.sh -w
script:
- sudo ./auto_install/install.sh --unattended ciscripts/ci_wireguard.conf
script:
- ./ciscripts/test_install.sh
- ./ciscripts/test.sh -w
after_fail:
- sudo journalctl -xe
@ -82,12 +86,14 @@ jobs:
dist: focal
virt: vm
arch: amd64
env:
- VPNPROTO=openvpn
before_script:
- sudo chmod +x ciscripts/*.sh
- ./ciscripts/pre_checks.sh
- ./ciscripts/startup.sh -o
script:
- sudo ./auto_install/install.sh --unattended ciscripts/ci_openvpn.conf
- ./ciscripts/test_install.sh
- ./ciscripts/test.sh -o
after_fail:
- sudo journalctl -xe
@ -97,12 +103,14 @@ jobs:
dist: focal
virt: vm
arch: amd64
env:
- VPNPROTO=wireguard
before_script:
- sudo chmod +x ciscripts/*.sh
- ./ciscripts/pre_checks.sh
- ./ciscripts/startup.sh -w
script:
- sudo ./auto_install/install.sh --unattended ciscripts/ci_wireguard.conf
script:
- ./ciscripts/test_install.sh
- ./ciscripts/test.sh -w
after_fail:
- sudo journalctl -xe
@ -112,12 +120,14 @@ jobs:
dist: jammy
virt: vm
arch: amd64
env:
- VPNPROTO=openvpn
before_script:
- sudo chmod +x ciscripts/*.sh
- ./ciscripts/pre_checks.sh
- ./ciscripts/startup.sh -o
script:
- sudo ./auto_install/install.sh --unattended ciscripts/ci_openvpn.conf
- ./ciscripts/test_install.sh
- ./ciscripts/test.sh -o
after_fail:
- sudo journalctl -xe
@ -127,12 +137,14 @@ jobs:
dist: jammy
virt: vm
arch: amd64
env:
- VPNPROTO=wireguard
before_script:
- sudo chmod +x ciscripts/*.sh
- ./ciscripts/pre_checks.sh
- ./ciscripts/startup.sh -w
script:
- sudo ./auto_install/install.sh --unattended ciscripts/ci_wireguard.conf
script:
- ./ciscripts/test_install.sh
- ./ciscripts/test.sh -w
after_fail:
- sudo journalctl -xe

16
ciscripts/test_install.sh Normal file
View file

@ -0,0 +1,16 @@
#!/bin/bash -e
if [[ "$TRAVIS_EVENT_TYPE" == "pull_request" ]]; then
echo "Pull Request, testing branch $TRAVIS_PULL_REQUEST_BRANCH on $TRAVIS_PULLREQUEST_SLUG"
sudo ./auto_install/install.sh --giturl https://github.com/"${TRAVIS_PULL_REQUEST_SLUG}" \
--gitbranch "${TRAVIS_PULL_REQUEST_BRANCH}" \
--unattended ciscripts/ci_"${VPNPROTO}".conf
else
if [[ "$TRAVIS_BRANCH" == "test" ]]; then
echo "Testing PiVPN Test branch"
sudo TESTING= ./auto_install/install.sh --unattended ciscripts/ci_"${VPNPROTO}".conf
else
echo "Testing PiVPN Master branch"
sudo ./autoinstall.sh --unattended ciscripts/ci_"${VPNPROTO}".conf
fi
fi