0

Trying to deploy an app to kubernetes using azure. I have a build pipeline yml file and in the pipeline i've set a variable called "discordToken". I tried setting it two different ways, one is called discordToken and the other is MY_MAPPED_ENV_VAR. in my node project i'm doing

console.log( process.env.discordToken )
console.log( process.env.MY_MAPPED_ENV_VAR )

but everything keeps coming back as undefined.

stages:
- stage: Build
  displayName: Build stage
  jobs:  
  - job: Build
    displayName: Build
    pool:
      vmImage: $(vmImageName)
      environment:
        discordToken: $(discordToken)
    steps:
    - powershell: |
      env:
        MY_MAPPED_ENV_VAR: $(discordToken)
    - task: Docker@2
      displayName: Build and push an image to container registry
      inputs:
        command: buildAndPush
        repository: $(imageRepository)
        dockerfile: $(dockerfilePath)
        containerRegistry: $(dockerRegistryServiceConnection)
        tags: |
          $(tag)

How should i be setting the environment variables?

4

1 に答える 1