nulldriver / maven-resource

Maven Repository Manager Concourse Resource
Apache License 2.0
21 stars 49 forks source link

Ignore redeploy errors. #6

Closed gsamuel1 closed 7 years ago

gsamuel1 commented 7 years ago

When trying to push a build that's already deployed, Nexus responds with a 400 "Bad Request". This is fine, as the correct build is already uploaded, but the build fails on the 400 - confusing product and developers as to the status of the pipeline.

It would be sweet if there was a switch on maven-resource we could flip in order to allow this duplicate error to still make the build green.

Thanks!

patrickcrocker commented 7 years ago

We could implement a disable_redeploy flag on the resource configuration:

- name: maven-release
  type: maven-resource
  source:
    url: {{maven-release-url}}
    artifact: com.example:myartifact:jar
    username: {{maven-release-username}}
    password: {{maven-release-password}}
    skip_cert_check: {{maven-release-skip-ssl}}
    disable_redeploy: true

If disable_redeploy: true (defaults to false) we would use curl to check for the existence of the artifact in the repository before running the mvn deploy:deploy-file command.

Please let me know if this would satisfy your needs.

patrickcrocker commented 7 years ago

https://www.pivotaltracker.com/n/projects/1789539/stories/128755915

pcrocker-pivotal commented 7 years ago

oops, wrong Pivotal Tracker story. This is the correct one: https://www.pivotaltracker.com/n/projects/1789539/stories/142618725

patrickcrocker commented 7 years ago

Implemented in 1.3.0/latest