Skip to content

environment variables are not respected #47

Open
@svscorp

Description

@svscorp

Hi all,

I'm troubleshooting why my environment variables specified in the build-env are not picked up by the application.

Using this pipeline code

        - task: vercel-deployment-task@1
          displayName: Deploy
          inputs:
            vercelToken: $(VERCEL_TOKEN)
            vercelOrgId: $(VERCEL_ORG_ID)
            production: true
            debug: true
            buildEnv: 'KEY1=VAL1 --build-env KEY2=VAL2'
            vercelCwd: 'client'

In the logs, I see (Vercel CLI 41.1.1): /usr/local/bin/vercel deploy --prod --token=*** --cwd=client --build-env KEY1=VAL1 --build-env KEY2=VAL2. When I check further debug logs I can't see these variables in the"Deployment response": ..."build":{"env":["CI","VERCEL",.....

When I run via cli (Vercel CLI 41.1.0) from my shell vercel deploy --prod --token=*** --cwd=client --build-env KEY1=VAL1 --build-env KEY2=VAL2 the environment configuration is picked up by the application. Also, I can see these KEY1 and KEY2 variables in the further output of "Deployment response": ..."build":{"env":["CI","VERCEL","KEY1","KEY2",.....

Any thoughts?

UPDATE: Wrote manually in the pipeline: vercel link + vercel deploy with the same arguments, and it worked.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions