How to set an environment variable in the middle o

2019-07-27 02:05发布

I have a project that uses create-react-app for creating my react app, and I'm using Azure DevOps to build the project and run tests, but there is a problem.

In order to run tests in a CI environment, you have to create an environment variable CI=true, but this has the effect that the build script fails if warnings are found (and my project have warnings).

So my idea is running the build script first, then set the variable, then run the tests, but I haven't found how to set the variable.

1条回答
劳资没心,怎么记你
2楼-- · 2019-07-27 02:45

Add a Powershell task in the middle of the build and set the variable there:

enter image description here

查看更多
登录 后发表回答