Saltstack [SOLVED]: Use of artifactory.download not working for snapshot version in Salt-stack

Saltstack [SOLVED]: Use of artifactory.download not working for snapshot version in Salt-stack

Home Forums Automation Tools Saltstack Tutorials Saltstack [SOLVED]: Use of artifactory.download not working for snapshot version in Salt-stack

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #166112

    Cloudy Point
    Keymaster

    QuestionQuestion

    I use saltstack to deploy my application on AWS. The formulas fetch the jar from artifactory and run the application as a service.

    It works fine for production(release version ex: 1.1.3) but it fails on dev environment with snapshot version (ex: 1.1.4-SNAPSHOT).

    My formula :

    artifactory.downloaded:
       - artifact:
            artifactory_url: {{ artifactory_url }}
            repository: {{ repository }}
            artifact_id: {{ artifact_id }}
            group_id: {{ group_id }}
            packaging: {{ packaging }}
            classifier: {{ classifier }}
            version: '{{ version }}'
       - target_dir: {{ folder }}
    

    The error: 'NoneType' object is not iterable

    #166113

    Cloudy Point
    Keymaster

    Accepted AnswerAnswer

    I think I figure it out.

    The state artifactory.downloaded use the module artifactory.get_snapshot for snapshot and artifactory.get_release for release.

    The get_snapshot module needs a snapshot_version properties and version properties (I think it’s an issue) but you can’t pass snapshot_version properties from artifactory.downloaded state.

    So to resolve this issue, I don’t longer use artifactory.downloaded state but artifactory.get_snapshot / artifactory.get_release module :

    artifact_download:
     module.run:
        - name: artifactory.get_snapshot
        - artifactory_url: {{ artifactory_url }}
        - repository: {{ repository }}
        - artifact_id: {{artifact_id }}
        - group_id: {{ group_id }}
        - packaging: {{ packaging }}
        - classifier: {{ classifier }}
        - version: '{{ version }}'
        - snapshot_version: '{{ version }}'
        - target_dir: {{ folder }}
    

    ?? – snapshot_version and version properties are both required.

    Source: https://stackoverflow.com/questions/45411857/use-of-artifactory-download-not-working-for-snapshot-version-in-salt-stack
    Author: Martin Choraine
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.