-
Notifications
You must be signed in to change notification settings - Fork 1
/
full-tests.sh
executable file
·34 lines (28 loc) · 1.17 KB
/
full-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -euo pipefail
# This tests against proxy deployed with TLS and DNS.
#
tmp=$(mktemp -d)
trap 'rm -rf $tmp' EXIT
# test valid repos
git clone https://github-proxy.opensafely.org/opensafely/documentation "$tmp/documentation"
git clone https://github-proxy.opensafely.org/opensafely-core/job-runner "$tmp/job-runner"
if git clone https://github-proxy.opensafely.org/torvalds/linux "$tmp/linux"; then
echo "ERROR: succesful cloned torvalds/linux!"
exit 1
fi
# test we can push, not sure it is worth testing, as it needs creds
#git -C "$tmp/documentation" checkout -b proxy-test-branch
#touch "$tmp/documentation/test"
#git -C "$tmp/documentation" add test
#git -C "$tmp/documentation" ci -m "test"
#git -C "$tmp/documentation" push origin proxy-test-branch --force
#git -C "$tmp/documentation" push origin proxy-test-branch --delete
docker pull docker-proxy.opensafely.org/opensafely-core/base-docker
# we shouldn't be allowed to pull opensafely images, just opensafely-core
code=0
docker pull docker-proxy.opensafely.org/opensafely/busybox 2>/dev/null || code=$?
if test "$code" = "0"; then
echo "ERROR: succesfully pulled opensafely/busybox image"
exit 1
fi