%PDF- %PDF-
| Direktori : /proc/self/root/proc/thread-self/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/thread-self/root/usr/lib/python2.7/site-packages/salt/states/artifactory.pyc |
�
���^c @@ sl d Z d d l m Z m Z m Z d d l Z d d l m Z e j e � Z
d d e d � Z
d � Z d S( u3
This state downloads artifacts from artifactory.
i ( t absolute_importt print_functiont unicode_literalsN( t sixu /tmpc C@ s t j d | � i | d 6t d 6i d 6d d 6} d t k r� t d t k r� i } t | d <d j | d
� | d <i | d <nM y t | | | | � } Wn1 t k
r� } t | d <t j | � | d <| SXt j d | � | d | d <| d | d <| d | d <t j d | � | S(
u
Ensures that the artifact from artifactory exists at given location. If it doesn't exist, then
it will be downloaded. If it already exists then the checksum of existing file is checked against checksum
in artifactory. If it is different then the step will fail.
artifact
Details of the artifact to be downloaded from artifactory. Various options are:
- artifactory_url: URL of the artifactory instance
- repository: Repository in artifactory
- artifact_id: Artifact ID
- group_id: Group ID
- packaging: Packaging
- classifier: Classifier
.. versionadded:: 2015.8.0
- version: Version
One of the following:
- Version to download
- ``latest`` - Download the latest release of this artifact
- ``latest_snapshot`` - Download the latest snapshot for this artifact
- username: Artifactory username
.. versionadded:: 2015.8.0
- password: Artifactory password
.. versionadded:: 2015.8.0
target_dir
Directory where the artifact should be downloaded. By default it is downloaded to /tmp directory.
target_file
Target file to download artifact to. By default file name is resolved by artifactory.
An example to download an artifact to a specific file:
.. code-block:: yaml
jboss_module_downloaded:
artifactory.downloaded:
- artifact:
artifactory_url: http://artifactory.intranet.example.com/artifactory
repository: 'libs-release-local'
artifact_id: 'module'
group_id: 'com.company.module'
packaging: 'jar'
classifier: 'sources'
version: '1.0'
- target_file: /opt/jboss7/modules/com/company/lib/module.jar
Download artifact to the folder (automatically resolves file name):
.. code-block:: yaml
jboss_module_downloaded:
artifactory.downloaded:
- artifact:
artifactory_url: http://artifactory.intranet.example.com/artifactory
repository: 'libs-release-local'
artifact_id: 'module'
group_id: 'com.company.module'
packaging: 'jar'
classifier: 'sources'
version: '1.0'
- target_dir: /opt/jboss7/modules/com/company/lib
uC ======================== STATE: artifactory.downloaded (name: %s) u nameu resultu changesu u commentu testu statusu* Artifact would be downloaded from URL: {0}u artifactory_urlu fetch_result = %su ret = %s(
t logt debugt Truet __opts__t formatt __fetch_from_artifactoryt Exceptiont FalseR t text_type( t namet artifactt
target_dirt target_filet use_literal_group_idt rett fetch_resultt exc( ( s; /usr/lib/python2.7/site-packages/salt/states/artifactory.pyt
downloaded s, B
c C@ sF d | k r | d s&