-
Notifications
You must be signed in to change notification settings - Fork 41
/
pre.yaml
41 lines (37 loc) · 2.25 KB
/
pre.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
- hosts: controller
tasks:
- name: Setup download-artifact-fork role
include_role:
name: download-artifact-fork
vars:
download_artifact_directory: "{{ zuul.projects['github.com/ansible/network-ee'].src_dir }}/_build/collections"
download_artifact_type: ansible_collection
- name: Adjust the requirements.yaml file to point on the local colletion tarballs
replace:
path: "{{ zuul.projects['github.com/ansible/network-ee'].src_dir }}/_build/requirements.yml"
regexp: "{{ item.name }}$"
replace: "collections/{{ item.url | basename }}"
with_items: "{{ zuul.artifacts }}"
when: "'metadata' in item and 'type' in item.metadata and (item.metadata.type == 'ansible_collection')"
- name: Install podman
package:
name: podman
state: present
become: true
- name: Build the image
shell: |
set -eux
podman pull quay.io/ansible/ansible-runner:{{ ansible_runner_container_version }}
podman pull quay.io/ansible/ansible-builder:latest
podman pull quay.io/ansible/python-builder:latest
ANSIBLE_GALAXY_CLI_COLLECTION_OPTS=""
if [ ! "{{ ansible_runner_container_version }}" = "stable-2.9-devel" ]; then
ANSIBLE_GALAXY_CLI_COLLECTION_OPTS="--pre"
fi
podman build . --pull-never --build-arg ANSIBLE_GALAXY_CLI_COLLECTION_OPTS=$ANSIBLE_GALAXY_CLI_COLLECTION_OPTS --build-arg EE_BASE_IMAGE=quay.io/ansible/ansible-runner:{{ ansible_runner_container_version }} --tag quay.io/ansible/network-ee:to-test
podman build tests --pull-never --build-arg NETWORK_EE_IMAGE=quay.io/ansible/network-ee:to-test --tag quay.io/ansible/network-ee-tests:to-test
podman build tests --pull-never --file Containerfile.ansible-test --target network-ee-unit-tests --build-arg NETWORK_EE_TESTS_IMAGE=quay.io/ansible/network-ee-tests:to-test --tag quay.io/ansible/network-ee-unit-tests:to-test
podman build tests --pull-never --file Containerfile.ansible-test --target network-ee-sanity-tests --build-arg NETWORK_EE_TESTS_IMAGE=quay.io/ansible/network-ee-tests:to-test --tag quay.io/ansible/network-ee-sanity-tests:to-test
args:
chdir: "{{ zuul.projects['github.com/ansible/network-ee'].src_dir }}"