Deploy Plugin task in Deployment Plan template copies the artifact ID of the template, not using the correct one
Hi! I've just started using this plugin and i noticed an issue with our Deployment plans. I have many deployment tasks for atlassian plugins that directly deploy the artifact from the build to an atlassian tool, and normally this artifact is selected in screen (with a dropdown box); but when this is templated, the selection of the artifact (of the plan the replicates the template) shows correct (the right artifact that should be used) but the data underlying it is still pointing to an artifact from the template, not to the correct build associated with the plan. I noticed it because our deployment kept failing with the error "Artifact ID XXXXXX doesn't exist" but it was correctly downloaded, and to workaround this I delete the replicated deployment task and manually re-create it with the same parameters (which as you see, has to be done every time the deployment plans replicates in all the replications).
Comments (11)
-
repo owner -
repo owner Hi Roberto,
I have been looking at the code and this doesn't make any sense to me, I was pretty sure that I don't touch artifact downloader tasks or checkout tasks. Can you tell me which plugin are you using to retrieve the artifacts, is it the regular Bamboo artifact downloader or something else ?
Thanks, Julius
-
Account Deleted Just the regular artifact definition. In fact, i only have 1 artifact for this build, and the UI of the task always shows as if it's selected and can't unselect or switch to another one, that's why i had to delete and re-create the task
-
repo owner I hope I found the issue, there are 2 keys in bamboo internal plugins for artifact download, probably the second one is used in deployment projects. I will try to test on my plans tonight and do a release tomorrow for you.
Julius
-
repo owner Released, try to make a new environment and just replicate.
Julius
-
Account Deleted I just tried it again with the updated version but still the same issue, still have to remove and re-create deployment task so it takes the right artifact ID. I can confirm the replicated faulty task uses the artifact ID for the template because when i try to deploy 2 different deployment plans that point to 2 different build plans but are replicated from the same template, in both of their failure logs it asks about the same artifact ID.
-
repo owner Strange, it should not replicate at all any artifact downloads, I will add some extra debugging and republish so we can check.
Julius
-
repo owner Can you update now and do a replication so we can see which tasks are being deleted and created by the plugin.
Julius
-
Account Deleted Here's a screenshot of the task set for this environment. The main one that fails is Deploy plugin task.
-
repo owner Oh, now I got what you mean but I am afraid I cannot do much. You would like the templating plugin to understand the jobs you have, artifact definition and select the right one for deployment.
For sure I can try to help you but we would be introducing a very specific case in the templating plugin and it would have a few risks (not sure how to handle multiple jobs in a single stage producing various plugins or multiple stages with multiple plugin produced)
Please install the latest plugin I gave you, run the templating once and provide me the output. I will try to understand what needs to be done (I will try to handle the easy scenario - a single job with a single artifact definition).
Julius
-
repo owner Hi Roberto,
try to update now and we see, I added some special handling for the particular plugin you are using.
I am taking the artifact ID you select in the environment downloader task and populating the same into the deploy task.
Julius
- Log in to comment
Hi Roberto,
it is a known issue, if you update the artifact definition on the template and replicate to all build plans the deployment projects may result having old artifact definitions linked. Normally the UI is handling this by preventing users from performing some actions but during an automated replication this is quite difficult to handle.
If this is a blocker we can try something out at the moment I made sure that artifacts dont get affected multiple times during consecutive replications, usage sample:
Another risk is multi-stage plans with same template - here you need to disable artifact definition templating on one of the jobs as it will result in duplicates.
Tell me your toughts and we can work around the issues you are facing, I have recently added deployment plan templating, should be easier now to dig deeper in the artifact handling and replications.
Julius