-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure Devops (pipelines) for deploying multi apps (angular and nestjs) ? #1930
Comments
We are doing this by adding tags to the build. Each affected app is added as tag. You can use azure devops rest api for that (poweshell or node.js there is a node client available). You need then for each app a release pipeline. For each release pipeline you can define artifact filters based on build tags. |
Thanks @elvirdolic , I am still learning azure :-) I presume then I need to write a small nodejs script to call the rest service. Would you have the link to the docs for that ? The tag that is added, is a one off tag, i mean, right now the pipeline we detect a new PUSH on github and run the yaml file, so I presume that the filters need to be added on the yml level ? to check for the tag - and next push the tags are reset ? |
I think I have the concept more or less now :-) The tags are added to the buildId. And I am able to use the AZ command line tools to add the tags using a buildID. I will attempt it after doing a little further investigation. |
@iangregsondev I'm also trying to do this. This is how I build angular applications. |
This has been really helpful Thanks |
@mbriggs is putting together an example. Matt, once you are done, can you link it here and closer the issue? |
We've also been searching for this and built it ourself. We use build tags and specify release triggers based on the build tag. To add the tags inside the build, we simply use this single line of bash:
It works for app names containing numbers, letters, (We're echoing |
Hi, sorry about this. This was mislabeled as stale. We are testing ways to mark not reproducible issues as stale so that we can focus on actionable items but our initial experiment was too broad and unintentionally labeled this issue as stale. |
Hi, I'm struggling alot with this. I've created a release pipeline which is linked on my monorepo and I added a build tag which is the name of my application. Is that correct? Now I believe I should add a build tag for each artifact that is created while running the build pipeline. Am I understanding it correctly? If yes, then I really don't understand how to do so. When and how am I supposed to add those build tags? Many thanks |
What we did is to read all folders from the dist dir which contains all builded apps then we use the azure devops rest api to add the build tags based on the folder names. This is done as last step of the build Pipeline |
@GreatHawkeye we're using the Simply have a look at the bash command I wrote in december. We're using it to tag the builds. You'll just have to include the execution of it in your build pipeline: |
@NiklasPor Thank you for your answer.
|
@GreatHawkeye looks pretty solid, except you'll need to change the base to match your other affected command. Instead of |
@NiklasPor , awesome, it worked!! So if I understand it correctly, what just happened is that the entire build has now 2 tags linked to it. How does the build tag filter works? In my (poor) understanding, the generated build has both tags, how can my release pipelines filter the correct folder to deploy (which is |
Yes, you'll now need different release pipelines for the different tagged builds. One pipeline for each application. (We also have the different stages of that release inside that pipeline). Sadly you'll have to do the extracting yourself. E.g. copying the files from one app folder to wherever you wanna do release stuff with them. You can extract the common tasks shared by all release pipelines into task groups, so that you'll only have to write that once. |
Okay so I believe I should I found this snippet :
I'm guessing I have to replace Does that make sense if I store the result of your |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
How can I share installed node modules from the install/setup command across other jobs? |
@NiklasPor (or anyone else) interested to know if you have made any changes to support YAML Pipeline now that Classic Release pipelines are deprecated in Azure. As far as I can tell, build tags are no longer helpful with these new pipelines so I am looking for an alternative. |
Ignore me, it looks like build tag triggers are still a thing for YAML Pipelines. Hopefully this will help others. |
Haha yes, it works the same with the yaml pipelines 🚀 |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Expected Behavior
Hi, I am hoping that somebody is doing something similar and can share there azure-pipelines.yml file :-)
Trying to use azure pipelines to build the projects (there is 1 angular and 1 nestjs) and automatically release.
The thing where I am getting confused is, technically there are 2 apps, and each push to master causes a build, but I only want to build and release the artifact if its changed.
Anybody doing something with the azure pipelines ?
I presume that I need to use the affected scripts and build only if changed but then how for the release artifacts to support deploying 1 or more apps.
Look forward to any insight anyone has :-)
I am at a loss right now.
The text was updated successfully, but these errors were encountered: