Skip to content

Commit

Permalink
only attempt to build images when needed
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
  • Loading branch information
BeryJu committed Jan 31, 2025
1 parent a933642 commit 64be9f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ docker: ## Build a docker image of the current source tree
DOCKER_BUILDKIT=1 docker build . --progress plain --tag ${DOCKER_IMAGE}

test-docker:
./scripts/test_docker.sh
BUILD=true ./scripts/test_docker.sh

#########################
## CI
Expand Down
20 changes: 12 additions & 8 deletions scripts/test_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@ fi

echo PG_PASS="$(openssl rand -base64 36 | tr -d '\n')" >.env
echo AUTHENTIK_SECRET_KEY="$(openssl rand -base64 60 | tr -d '\n')" >>.env
echo AUTHENTIK_IMAGE="${AUTHENTIK_IMAGE}" >>.env
echo AUTHENTIK_TAG="${AUTHENTIK_TAG}" >>.env
export COMPOSE_PROJECT_NAME="authentik-test-${AUTHENTIK_TAG}"

# Ensure buildx is installed
docker buildx install
# For release builds we have an empty client here as we use the NPM package
mkdir -p ./gen-ts-api
touch .env
if [[ -v BUILD ]]; then
echo AUTHENTIK_IMAGE="${AUTHENTIK_IMAGE}" >>.env
echo AUTHENTIK_TAG="${AUTHENTIK_TAG}" >>.env

# Ensure buildx is installed
docker buildx install
# For release builds we have an empty client here as we use the NPM package
mkdir -p ./gen-ts-api
touch .env

docker build -t "${AUTHENTIK_IMAGE}:${AUTHENTIK_TAG}" .
fi

docker build -t "${AUTHENTIK_IMAGE}:${AUTHENTIK_TAG}" .
docker compose up --no-start
docker compose start postgresql redis
docker compose run -u root server test-all
Expand Down

0 comments on commit 64be9f3

Please sign in to comment.