test(nginx): fix tests to work in GHA (#1372)
* test(nginx): fix tests to work in GHA Closes: #1371 Signed-off-by: Xe Iaso <me@xeiaso.net> * fix(test): does this work lol Signed-off-by: Xe Iaso <me@xeiaso.net> * fix(test): does this other thing work lol Signed-off-by: Xe Iaso <me@xeiaso.net> * fix(test): pki folder location Signed-off-by: Xe Iaso <me@xeiaso.net> --------- Signed-off-by: Xe Iaso <me@xeiaso.net> Signed-off-by: Jason Cameron <git@jasoncameron.dev> Co-authored-by: Jason Cameron <git@jasoncameron.dev>
This commit is contained in:
parent
880020095c
commit
1d8e98c5ec
5 changed files with 48 additions and 52 deletions
|
|
@ -1,53 +1,56 @@
|
|||
REPO_ROOT=$(git rev-parse --show-toplevel)
|
||||
(cd $REPO_ROOT && go install ./utils/cmd/...)
|
||||
|
||||
mkdir -p pki
|
||||
echo '*' >>./pki/.gitignore
|
||||
|
||||
function cleanup() {
|
||||
set +e
|
||||
set +e
|
||||
|
||||
pkill -P $$
|
||||
pkill -P $$
|
||||
|
||||
if [ -f "docker-compose.yaml" ]; then
|
||||
docker compose down -t 1 || :
|
||||
docker compose rm -f || :
|
||||
fi
|
||||
if [ -f "docker-compose.yaml" ]; then
|
||||
docker compose down -t 1 || :
|
||||
docker compose rm -f || :
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT SIGINT
|
||||
|
||||
function build_anubis_ko() {
|
||||
(
|
||||
cd $REPO_ROOT && npm ci && npm run assets
|
||||
)
|
||||
(
|
||||
cd $REPO_ROOT &&
|
||||
VERSION=devel ko build \
|
||||
--platform=all \
|
||||
--base-import-paths \
|
||||
--tags="latest" \
|
||||
--image-user=1000 \
|
||||
--image-annotation="" \
|
||||
--image-label="" \
|
||||
./cmd/anubis \
|
||||
--local
|
||||
)
|
||||
(
|
||||
cd $REPO_ROOT && npm ci && npm run assets
|
||||
)
|
||||
(
|
||||
cd $REPO_ROOT &&
|
||||
VERSION=devel ko build \
|
||||
--platform=all \
|
||||
--base-import-paths \
|
||||
--tags="latest" \
|
||||
--image-user=1000 \
|
||||
--image-annotation="" \
|
||||
--image-label="" \
|
||||
./cmd/anubis \
|
||||
--local
|
||||
)
|
||||
}
|
||||
|
||||
function mint_cert() {
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage: mint_cert <domain.name>"
|
||||
fi
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage: mint_cert <domain.name>"
|
||||
fi
|
||||
|
||||
domainName="$1"
|
||||
domainName="$1"
|
||||
|
||||
# If the transient local TLS certificate doesn't exist, mint a new one
|
||||
if [ ! -f "${REPO_ROOT}/test/pki/${domainName}/cert.pem" ]; then
|
||||
# Subshell to contain the directory change
|
||||
(
|
||||
cd ${REPO_ROOT}/test/pki &&
|
||||
mkdir -p "${domainName}" &&
|
||||
go tool minica -domains "${domainName}" &&
|
||||
cd "${domainName}" &&
|
||||
chmod 666 *
|
||||
)
|
||||
fi
|
||||
# If the transient local TLS certificate doesn't exist, mint a new one
|
||||
if [ ! -f "./pki/${domainName}/cert.pem" ]; then
|
||||
# Subshell to contain the directory change
|
||||
(
|
||||
cd ./pki &&
|
||||
mkdir -p "${domainName}" &&
|
||||
go tool minica -domains "${domainName}" &&
|
||||
cd "${domainName}" &&
|
||||
chmod 666 *
|
||||
)
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue