diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 40c8e031..0ba23a9f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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 diff --git a/test.Dockerfile b/e2e-tests.Dockerfile similarity index 93% rename from test.Dockerfile rename to e2e-tests.Dockerfile index 2cf6f9fd..b351e403 100644 --- a/test.Dockerfile +++ b/e2e-tests.Dockerfile @@ -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 ## diff --git a/test.Dockerfile.dockerignore b/e2e-tests.Dockerfile.dockerignore similarity index 84% rename from test.Dockerfile.dockerignore rename to e2e-tests.Dockerfile.dockerignore index b2b98fdf..9468551a 100644 --- a/test.Dockerfile.dockerignore +++ b/e2e-tests.Dockerfile.dockerignore @@ -3,8 +3,7 @@ # Except these !kdk/* -!kapp/test/* -!kapp/package.json +!kapp/* # But ignore these anyway **/node_modules diff --git a/scripts/build_e2e_tests.sh b/scripts/build_e2e_tests.sh index 5a2af6df..16a4fcdb 100755 --- a/scripts/build_e2e_tests.sh +++ b/scripts/build_e2e_tests.sh @@ -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 ## @@ -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" @@ -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 ..."