mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-26 18:12:45 +00:00
test(nginx): fix tests to work in GHA
Closes: #1371 Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
+5
-2
@@ -1,6 +1,9 @@
|
|||||||
REPO_ROOT=$(git rev-parse --show-toplevel)
|
REPO_ROOT=$(git rev-parse --show-toplevel)
|
||||||
(cd $REPO_ROOT && go install ./utils/cmd/...)
|
(cd $REPO_ROOT && go install ./utils/cmd/...)
|
||||||
|
|
||||||
|
mkdir -p pki
|
||||||
|
echo '*' >>./pki/.gitignore
|
||||||
|
|
||||||
function cleanup() {
|
function cleanup() {
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
@@ -40,10 +43,10 @@ function mint_cert() {
|
|||||||
domainName="$1"
|
domainName="$1"
|
||||||
|
|
||||||
# If the transient local TLS certificate doesn't exist, mint a new one
|
# If the transient local TLS certificate doesn't exist, mint a new one
|
||||||
if [ ! -f "${REPO_ROOT}/test/pki/${domainName}/cert.pem" ]; then
|
if [ ! -f "./pki/${domainName}/cert.pem" ]; then
|
||||||
# Subshell to contain the directory change
|
# Subshell to contain the directory change
|
||||||
(
|
(
|
||||||
cd ${REPO_ROOT}/test/pki &&
|
cd ./pki &&
|
||||||
mkdir -p "${domainName}" &&
|
mkdir -p "${domainName}" &&
|
||||||
go tool minica -domains "${domainName}" &&
|
go tool minica -domains "${domainName}" &&
|
||||||
cd "${domainName}" &&
|
cd "${domainName}" &&
|
||||||
|
|||||||
+3
-12
@@ -1,24 +1,15 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
export VERSION=$GITHUB_COMMIT-test
|
|
||||||
export KO_DOCKER_REPO=ko.local
|
|
||||||
|
|
||||||
source ../lib/lib.sh
|
source ../lib/lib.sh
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
build_anubis_ko
|
|
||||||
mint_cert mimi.techaro.lol
|
mint_cert mimi.techaro.lol
|
||||||
|
|
||||||
docker run --rm -it \
|
docker run --rm \
|
||||||
-v ./conf/nginx:/etc/nginx:ro \
|
-v $PWD/conf/nginx:/etc/nginx:ro \
|
||||||
-v ../pki:/techaro/pki:ro \
|
-v $PWD/pki:/techaro/pki:ro \
|
||||||
nginx \
|
nginx \
|
||||||
nginx -t
|
nginx -t
|
||||||
|
|
||||||
docker compose up -d
|
|
||||||
|
|
||||||
docker compose down -t 1 || :
|
|
||||||
docker compose rm -f || :
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user