jfrog / bamboo-artifactory-plugin

Atlassian Bamboo plugin that enables traceable build artifacts with Artifactory
https://plugins.atlassian.com/plugin/details/27818
Apache License 2.0
42 stars 56 forks source link

Ability to disable publishing for plan branches. #21

Open jgeorgeson opened 8 years ago

jgeorgeson commented 8 years ago

It would be nice to have a checkbox to categorically/automatically disable publishing (both artifacts and buildInfo) for plan branches. I can do things like set the Maven Goals in the task to use a plan variable and override its value in the branch plan, but I still have to edit the task to disable both the artifacts and buildinfo individually, for every branch plan. This makes Bamboo's automatic plan branching problematic because it will automatically run a build of a newly created branch plan.

jgeorgeson commented 8 years ago

Actually it seems that tasks can't currently be modified/overridden in plan branches.

https://jira.atlassian.com/browse/BAM-13257 https://jira.atlassian.com/browse/BAM-12761

So if the plan is configured to have the Artifactory Maven 3 builder task publish artifacts and/or build info, all branches are forced to do so unless the Maven goal does not run either the package or install targets. But when building Eclipse plugin project with the Tycho maven plugins, tests are only run in the integration-test phase, which requires running the package goal.

How is the Artifactory Maven 3 builder task intended to be used with plan branches? I had wanted to have developers committing their work-for-review to a branch, automatically verified with a gatekeeper merge back to master (without commit). But it seems impossible to do this without also publishing the artifacts from the branch build. But the changes on the branch would not have been reviewed until there's a Pull Request submitted, so the artifacts from the branch should not be published (and if the artifacts aren't published I don't want a buildInfo published either).

eyalbe4 commented 8 years ago

Here is something that might help. You can conditionally disable artifacts and build info deployment to Artifactory for Maven, Gradle and Ivy tasks by passing 2 system properties to the build tool: artifactory.publish.artifacts and artifactory.publish.buildInfo You can pass these properties to your Maven command as follows: clean install -Dartifactory.publish.artifacts=false -Dartifactory.publish.buildInfo=false The values for system properties can be controlled with Bamboo variables, using different values for branches. Please let me know what you think. We'll add this information to the plugin documentation.

jgeorgeson commented 8 years ago

That sounds like a good workaround. But a checkbox in the task would still be the preferred solution. I think once there's a manual configuration change needed on the plan branch then Bamboo's automatic branch plan creation would need to be disabled. Otherwise there will always be at least one build from the branch without the configuration change (because I don't see an option for the automatic plan branches to be created disabled).