Deployment of matrix artifacts
I'm trying to figure out how to make two builds (from a matrix, each with a different API url in the environment), each deploy to their respective deployment environments;
environment:
NODE_ENV: production
matrix:
- API_URL: https://PROJECTNAME-dev.azurewebsites.net/
- API_URL: https://PROJECTNAME.azurewebsites.net/
install:
- npm install
build_script:
- npm run deploy
artifacts:
- path: dist
name: project-name
deploy:
- provider: Environment
name: PROJECTNAME-Dev
application: project-name
on:
branch: master
- provider: Environment
name: PROJECTNAME-Release
application: project-name
on:
branch: release/*
Currently, I get two build artifacts as expected, but no way to
deploy one to PROJECTNAME-Dev and the other to
PROJECTNAME-Release. I know I could use $(API_URL) in
the artifact name, but when that's a url it's not clean?
Phil
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac

Support Staff 1 Posted by Feodor Fitsner on 05 Sep, 2016 05:23 PM
Why would you need two build jobs for that?
Am I correct to understand that you are trying to deploy to "dev" environment on any push to "master" branch and to "release" environment on "release/*" branch?
2 Posted by Phil Dye on 05 Sep, 2016 06:00 PM
Correct... but also, the environment variable is used in the build, to set a url into the artifact output (it's a ReactJS single page app being built with webpack, so the artifact is a bunch of js). The dev environment points to a dev API, and release to a live API - as static assets, we can't set these values at 'runtime' from the webserver.
Support Staff 3 Posted by Feodor Fitsner on 05 Sep, 2016 06:07 PM
OK, then you can solve this problem with a little of PowerShell:
4 Posted by Phil Dye on 06 Sep, 2016 08:17 AM
Thanks Feodor, works perfectly - great support as always!
Phil
Phil Dye closed this discussion on 06 Sep, 2016 08:17 AM.