I am working on a deployment where we need produce an artifact (a DDL script to be run separately by an administrator). However, what we are finding is that the file in question is displayed twice (each with a different link address).
The artifact is created by saving the output of a method call to a file and then passing it to New-OctopusArtifact:
As you can see, we are logging the creation of the new artifact. Even though the message “Creating new artifact” only appears once two links appear in the Artifacts section.
Are you trying to create an artifact per target or just a single artifact per deployment? If its the latter, you might wanna execute the artifact creation script from the Octopus Server instead of from a specific Tentacle/Target.
I want to create one artifact per deployment. The thing is, the Generate SourceTriggers step is set to run on the Octopus Server. What I notice is that it is set to run on behalf of the Service role - and both David’s machine and APP-DEV-03 have these roles.
So, is the expected behaviour that even though the script is set to run on the Octopus Server it will run for each environment with the specified role?
That is the expected behavior yeah. The script step set up to run from the Octopus Server on behalf of machines with role “x” will run once per machine with that role.
If you want it to run only once then you’ll need to remove the role scope from that script step. If you were trying to use the role to make use of some variables scoped to it, scope those variables to that step instead.
This issue has been closed due to inactivity. If you encounter the same or a similar issue and require help, please open a new discussion (if we asked for logs or extra details in this thread, consider including them in the new thread). If you are the creator of this thread and believe it should not be closed let us know via our support email.