Debian Codegraph @

ansible_collections/community/hashi_vault/.github/actions/pull-ansible-test-images/action.yml

raw symbols SCIP
1 ---
2 name: Pull ansible-test docker images
3 description: Performs a docker pull against ansible-test docker image aliases
4 inputs:
5 working-directory:
6 description: The working directory to operate under. This should be the collection's directory.
7 required: false
8 ansible-test-invocation:
9 description: The options that will be passed to ansible-test.
10 required: true
11 runs:
12 using: composite
13 steps:
14 - shell: bash
15 run: pip install packaging
16
17 - shell: python
18 run: |
19 import os
20 import sys
21 from packaging import version
22 from ansible.release import __version__ as ansible_version
23
24 ver = version.parse(ansible_version)
25 cutoff = version.parse('2.12')
26
27 nwd = r'${{ inputs.working-directory }}'
28 if nwd:
29 os.chdir(nwd)
30
31 # not using ver >= cutoff because of pre-release/dev comparison logic
32 if ver.major > cutoff.major or (ver.major == cutoff.major and ver.minor >= cutoff.minor):
33 invo = r'${{ inputs.ansible-test-invocation }}'
34 sys.exit(os.system('ansible-test %s --prime-containers' % invo))
35
36 try:
37 from ansible_test._internal.util_common import get_docker_completion
38 except ImportError:
39 # 2.9
40 from ansible_test._internal.util import get_docker_completion
41
42 context = 'collection'
43 wanted = ['default']
44
45 dockers = get_docker_completion()
46
47 for alias, data in dockers.items():
48 if alias in wanted:
49 if 'context' not in data or data['context'] == context:
50 image = data['name']
51 print('pulling %s' % image)
52 os.system('docker pull %s' % image)