File tree Expand file tree Collapse file tree 5 files changed +33
-13
lines changed
.github/actions/build-test Expand file tree Collapse file tree 5 files changed +33
-13
lines changed Original file line number Diff line number Diff line change 35
35
shell : bash
36
36
id : ansible-builder-install
37
37
run : |
38
- python3 -m pip install ansible-builder
39
-
40
- - name : Verify ansible-builder installed
41
- shell : bash
42
- id : ansible-builder-verify
43
- run : |
44
- ansible-builder --version
38
+ python3 -m pip install ansible-builder ansible-navigator build
39
+ python3 -m build --outdir final/dist/ --wheel
45
40
46
41
- name : Create a build context and Containerfile for base EE
47
42
shell : bash
86
81
- name : Validate if the final image is a valid EE
87
82
shell : bash
88
83
run : |
89
- python3 -m pip install --upgrade ansible-navigator
90
- ansible-navigator --version
91
84
ansible-navigator run ${{ github.workspace }}/site.yml --ce docker --mode stdout --eei ${{ inputs.namespace }}/${{ inputs.final_image }}:test
92
85
93
86
- name : Run tests on the image before pushing with docker
Original file line number Diff line number Diff line change @@ -173,3 +173,6 @@ cython_debug/
173
173
174
174
.DS_Store
175
175
_readthedocs
176
+
177
+ # ansible-builder
178
+ context
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ ENV ANSIBLE_DEV_TOOLS_CONTAINER=1
95
95
# In OpenShift, container will run as a random uid number and gid 0. Make sure things
96
96
# are writeable by the root group.
97
97
RUN for dir in \
98
+ /tmp/dist \
98
99
/home/runner \
99
100
/home/runner/.ansible \
100
101
/home/runner/.ansible/tmp \
@@ -113,8 +114,8 @@ RUN for dir in \
113
114
114
115
# base ansible-dev-tools setup
115
116
116
- COPY ./requirements.txt requirements.txt
117
- RUN python3 -m pip install --no-cache-dir -r requirements.txt
117
+ COPY dist/*.whl /tmp/dist
118
+ RUN sh -ec -o pipefail "ls -1 /tmp/dist/*.whl | xargs -I '{}' python3 -m pip install --no-cache-dir '{}[server,lock]' && rm -rf /tmp/dist"
118
119
119
120
RUN \
120
121
mkdir -p ~/.ansible/roles /usr/share/ansible/roles /etc/ansible/roles && \
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ env_list =
8
8
lint
9
9
milestone
10
10
pkg
11
+ image
11
12
skip_missing_interpreters = true
12
13
13
14
[testenv]
@@ -107,3 +108,27 @@ commands =
107
108
rm -rfv {toxinidir}/dist/
108
109
python -m build --outdir {toxinidir}/dist/ {toxinidir}
109
110
sh -c " python -m twine check --strict {toxinidir}/dist/*"
111
+
112
+ [testenv:image]
113
+ description =
114
+ Build the container image
115
+ skip_install = true
116
+ deps =
117
+ ansible-builder
118
+ ansible-navigator
119
+ build
120
+ setuptools # https://github.com/ansible/ansible-builder/issues/644
121
+ commands_pre =
122
+ commands =
123
+ python -m build --outdir {toxinidir}/final/dist/ --wheel {toxinidir}
124
+ ansible-builder create -f execution-environment.yml --output-filename Containerfile -v3
125
+ podman build context/ --tag community-ansible-dev-tools-base:latest
126
+ podman build final/ --tag community-ansible-dev-tools:test
127
+ ansible-navigator run site.yml --ce podman --mode stdout --eei community-ansible-dev-tools:test
128
+ podman run --rm -v ./tests:/home/podman/tests \
129
+ --security-opt seccomp =unconfined --security-opt label =disable --security-opt apparmor =unconfined \
130
+ --cap-add =SYS_ADMIN --cap-add =SYS_RESOURCE \
131
+ --device /dev/fuse community-ansible-dev-tools:test \
132
+ -c " /home/podman/tests/test.sh"
133
+ allowlist_externals =
134
+ podman
You can’t perform that action at this time.
0 commit comments