2017-07-31 1 views
0

J'utilise saltstack pour déployer mon application sur AWS. Les formules récupèrent le fichier d'artefact et exécutent l'application en tant que service.L'utilisation de artifactory.download ne fonctionne pas pour la version snapshot dans Salt-stack

Cela fonctionne très bien pour la production (version de la version ex: 1.1.3) mais il échoue sur l'environnement de développement avec la version d'instantané (ex: 1.1.4-SNAPSHOT).

Ma formule:

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 }} 

L'erreur: 'NoneType' object is not iterable

Répondre

0

Je pense que je comprendre. L'état artifactory.downloaded utilise le module artifactory.get_snapshot pour l'instantané et artifactory.get_release pour la version.

Le module get_snapshot a besoin d'un snapshot_version propriétés et propriétés version (je pense qu'il est un problème), mais vous ne pouvez pas passer snapshot_version propriétés de artifactory.downloaded état.

Donc, pour résoudre ce problème, je ne pas utiliser plus artifactory.downloaded Etat, mais le module artifactory.get_snapshot/artifactory.get_release:

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 et version propriétés sont toutes deux nécessaires.