Created
September 3, 2015 11:17
-
-
Save MichaelF25/7e46d85b31d8ff12d6e6 to your computer and use it in GitHub Desktop.
Download maven artifacts from nexus via ansible only if artifact SHA1 checksum changed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Get package info from nexus | |
uri: url=http://{{host}}/service/local/artifact/maven/resolve?g={{group_id}}&a={{artifact_id}}&v={{artifact_version}}&r={{repository}}&p={{packaging}} | |
HEADER_Accept="application/json" | |
return_content=yes | |
register: nexus_result | |
- name: Save SHA1 checksum of package | |
copy: content="{{nexus_result.json.data.sha1}}" dest="./{{artifact_id}}.{{packaging}}.sha1" | |
register: package_sha1 | |
- name: Download package from nexus | |
get_url: url=http://{{host}}/service/local/artifact/maven/content?g={{group_id}}&a={{artifact_id}}&v={{artifact_version}}&r={{repository}}&p={{packaging}} | |
dest="./{{artifact_id}}.{{packaging}}" | |
force=yes | |
when: package_sha1.changed | |
register: nexus_package |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment