diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d308f13d..ff393232e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -179,6 +179,7 @@ jobs: CONTAINER_NGINX_IMAGE_REGISTRY="docker-registry.nginx.com" \ TAG="${{ matrix.container.version }}-${{ matrix.container.image }}" \ OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" \ + NGINX_LICENSE_JWT="${{ secrets.NGINX_LICENSE_JWT }}" \ make official-image-integration-test official-plus-image-integration-tests: @@ -190,25 +191,15 @@ jobs: matrix: container: - image: "alpine" - version: "3.20" - plus: "r32" + version: "3.21" + plus: "r34" release: "alpine" path: "/nginx-plus/agent" - image: "alpine" - version: "3.19" - plus: "r31" + version: "3.20" + plus: "r33" release: "alpine" path: "/nginx-plus/agent" - - image: "debian" - version: "bookworm" - plus: "r32" - release: "debian" - path: "/nginx-plus/agent" - - image: "debian" - version: "bookworm" - plus: "r31" - release: "debian" - path: "/nginx-plus/agent" steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 @@ -224,14 +215,15 @@ jobs: uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: registry: ${{ secrets.REGISTRY_URL }} - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} + username: ${{ secrets.NGINX_LICENSE_JWT }} + password: "none" - name: Run Integration Tests run: | go install github.com/goreleaser/nfpm/v2/cmd/nfpm@${{ env.NFPM_VERSION }} CONTAINER_NGINX_IMAGE_REGISTRY="${{ secrets.REGISTRY_URL }}" \ TAG="${{ matrix.container.plus }}-${{ matrix.container.image }}-${{ matrix.container.version }}" \ OS_RELEASE="${{ matrix.container.release }}" OS_VERSION="${{ matrix.container.version }}" IMAGE_PATH="${{ matrix.container.path }}" \ + NGINX_LICENSE_JWT='${{ secrets.NGINX_LICENSE_JWT }}' \ make official-image-integration-test performance-tests: diff --git a/Makefile b/Makefile index 307b209a0..708dc8e35 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ DOCKERFILE_PATH = "./test/docker/nginx-oss/$(CONTAINER_OS_TYPE)/Dockerfile" OFFICIAL_IMAGE_DOCKERFILE_PATH = "./test/docker/nginx-official-image/$(CONTAINER_OS_TYPE)/Dockerfile" IMAGE_PATH ?= "/nginx/agent" TAG ?= "" +NGINX_LICENSE_JWT ?= "" BUILD_DIR := build TEST_BUILD_DIR := build/test @@ -170,6 +171,7 @@ official-image-integration-test: $(SELECTED_PACKAGE) build-mock-management-plane TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} BUILD_TARGET="install" \ PACKAGES_REPO=$(OSS_PACKAGES_REPO) TAG=${TAG} PACKAGE_NAME=$(PACKAGE_NAME) BASE_IMAGE=$(BASE_IMAGE) DOCKERFILE_PATH=$(OFFICIAL_IMAGE_DOCKERFILE_PATH) \ OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) IMAGE_PATH=$(IMAGE_PATH) \ + NGINX_LICENSE_JWT=$(NGINX_LICENSE_JWT) \ go test -v ./test/integration/managementplane ./test/integration/auxiliarycommandserver performance-test: diff --git a/test/helpers/test_containers_utils.go b/test/helpers/test_containers_utils.go index f90ab3182..2df3c1275 100644 --- a/test/helpers/test_containers_utils.go +++ b/test/helpers/test_containers_utils.go @@ -8,6 +8,7 @@ package helpers import ( "context" "io" + "os" "testing" "github.com/docker/docker/api/types" @@ -44,6 +45,14 @@ func StartContainer( tag := Env(tb, "TAG") imagePath := Env(tb, "IMAGE_PATH") + var env map[string]string + if os.Getenv("NGINX_LICENSE_JWT") != "" { + nginxLicenseJwt := os.Getenv("NGINX_LICENSE_JWT") + env = map[string]string{ + "NGINX_LICENSE_JWT": nginxLicenseJwt, + } + } + req := testcontainers.ContainerRequest{ FromDockerfile: testcontainers.FromDockerfile{ Context: "../../../", @@ -87,6 +96,7 @@ func StartContainer( FileMode: configFilePermissions, }, }, + Env: env, } container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{