I have this pipeline:
trigger:
- credium-dev
variables:
dockerRegistryServiceConnection: "none"
imageRepository: "none"
containerRegistry: "none"
dockerfilePath: "$(Build.SourcesDirectory)/Dockerfile.prod"
tag: "$(Build.BuildId)"
vmImageName: "ubuntu-latest"
pool:
vmImage: ubuntu-latest
stages:
- stage: Install
displayName: "Install"
jobs:
- job: InstallJob
displayName: "Install Node.js and Dependencies"
steps:
- task: NodeTool@0
inputs:
versionSpec: "20.x"
displayName: "Install Node.js"
- script: |
npm install
displayName: "Install Node.js and Dependencies"
- stage: UnitComponentTests
displayName: "Run Unit and Component Tests"
jobs:
- job: UnitComponentTestsJob
displayName: "Run Unit and Component Tests"
steps:
- script: |
npm install
npm run test
displayName: "Run Unit and Component Tests"
- stage: E2ETests
displayName: "Run E2E Tests"
jobs:
- job: E2ETestsJob
displayName: "Run E2E Tests"
steps:
- bash: |
echo "CLERK_SECRET_KEY: $(CLERK_SECRET_KEY)"
echo "NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: $(NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY)"
echo "DOCKER_CLERK_E2E_TEST_USERNAME: $(DOCKER_CLERK_E2E_TEST_USERNAME)"
echo "DOCKER_CLERK_E2E_TEST_PASSWORD: $(DOCKER_CLERK_E2E_TEST_PASSWORD)"
echo "DOCKER_CREDIUM_BASE_URL: $(DOCKER_CREDIUM_BASE_URL)"
echo "DOCKER_CREDIUM_TOKEN: $(DOCKER_CREDIUM_TOKEN)"
echo "DOCKER_MAPBOX_ACCESS_TOKEN: $(DOCKER_MAPBOX_ACCESS_TOKEN)"
- script: |
npm install
npx playwright install
npm run test-e2e
displayName: "Run E2E Tests"
env:
CLERK_SECRET_KEY: "$(CLERK_SECRET_KEY)"
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: "$(NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY)"
DOCKER_CLERK_E2E_TEST_USERNAME: "$(DOCKER_CLERK_E2E_TEST_USERNAME)"
DOCKER_CLERK_E2E_TEST_PASSWORD: "$(DOCKER_CLERK_E2E_TEST_PASSWORD)"
DOCKER_CREDIUM_BASE_URL: "$(DOCKER_CREDIUM_BASE_URL)"
DOCKER_CREDIUM_TOKEN: "$(DOCKER_CREDIUM_TOKEN)"
DOCKER_MAPBOX_ACCESS_TOKEN: "$(DOCKER_MAPBOX_ACCESS_TOKEN)"
- stage: Build
displayName: Build
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
buildContext: "./"
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
latest
In the E2E stage, I’m trying to access the Azure Environment variables for testing, however I’m getting empty values and these logs:
The env variables are defined in the Azure: