Skip to content

Commit

Permalink
ci: improve e2e tests #149
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan-greffe committed Mar 22, 2024
1 parent f15b6f6 commit 1bef431
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Build e2e tests
env:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
run: bash ./scripts/build_e2e_tests.sh
run: bash ./scripts/build_e2e_tests.sh -p

build_app:
name: Build app
Expand Down
3 changes: 3 additions & 0 deletions test.Dockerfile → e2e-tests.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## DEVELOPERS NOTE:
## This Dockerfile must be run with the --cap-add=SYS_ADMIN option to ensure proper functionality.

## Use a builder
##

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

# Except these
!kdk/*
!kapp/test/*
!kapp/package.json
!kapp/*

# But ignore these anyway
**/node_modules
Expand Down
14 changes: 7 additions & 7 deletions scripts/build_e2e_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ FLAVOR=$(get_app_flavor)

echo "About to build ${APP} v${VERSION}-$FLAVOR ..."

load_env_files "$WORKSPACE_DIR/development/common/kalisio_dockerhub.enc.env" "$WORKSPACE_DIR/development/common/SLACK_WEBHOOK_APPS.enc.env"
load_value_files "$WORKSPACE_DIR/development/common/KALISIO_DOCKERHUB_PASSWORD.enc.value"
load_env_files "$WORKSPACE_DIR/development/common/kalisio_harbor.enc.env" "$WORKSPACE_DIR/development/common/SLACK_WEBHOOK_APPS.enc.env"
load_value_files "$WORKSPACE_DIR/development/common/KALISIO_HARBOR_PASSWORD.enc.value"

## Build container
##
Expand All @@ -46,19 +46,19 @@ cp "$KLI_FILE" "$WORKSPACE_DIR/kli.js"

echo "Will use kli file $KLI_FILE to install and link modules ..."

IMAGE_NAME="kalisio/$APP-e2e-tests"
IMAGE_NAME="$KALISIO_HARBOR_URL/kalisio/$APP-e2e-tests"
IMAGE_TAG="$VERSION-$FLAVOR"

begin_group "Building container ..."

docker login --username "$KALISIO_DOCKERHUB_USERNAME" --password-stdin < "$KALISIO_DOCKERHUB_PASSWORD"
# DOCKER_BUILDKIT is here to be able to use Dockerfile specific dockerginore (app.Dockerfile.dockerignore)
docker login --username "$KALISIO_HARBOR_USERNAME" --password-stdin "$KALISIO_HARBOR_URL" < "$KALISIO_HARBOR_PASSWORD"
# DOCKER_BUILDKIT is here to be able to use Dockerfile specific dockerginore (e2e-tests.Dockerfile.dockerignore)
DOCKER_BUILDKIT=1 docker build \
--build-arg APP="$APP" \
--build-arg NODE_APP_INSTANCE="$FLAVOR" \
--build-arg SUBDOMAIN="$FLAVOR.kalisio.xyz" \
--build-arg HEADLESS=true \
-f test.Dockerfile \
-f e2e-tests.Dockerfile \
-t "$IMAGE_NAME:$IMAGE_TAG" \
"$WORKSPACE_DIR"
docker tag "$IMAGE_NAME:$IMAGE_TAG" "$IMAGE_NAME:$FLAVOR"
Expand All @@ -68,6 +68,6 @@ if [ "$PUBLISH" = true ]; then
docker push "$IMAGE_NAME:$FLAVOR"
fi

docker logout
docker logout "$KALISIO_HARBOR_URL"

end_group "Building container ..."

0 comments on commit 1bef431

Please sign in to comment.