Skip to content

Commit

Permalink
playbooks: Fix CI for containers#897 & restructure it
Browse files Browse the repository at this point in the history
adjustmnets to the Toolbx binary that it requires presence of /run/host
in both the host filesystem and the filesystem in a container.

The presence of the directory is assured by systemd-tmpfiles by
running it before the binary is started for the first time. This lead
to the realization that the playbook structure is needlessly
separated and can be unified as there is close to no benefit in keeping
it separated.

containers#898
  • Loading branch information
HarryMichal committed Oct 22, 2021
1 parent 6063eb2 commit 2a5337a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 50 deletions.
1 change: 1 addition & 0 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
nodes:
- name: ci-node-33
label: cloud-fedora-33-small
pre-run: playbooks/setup-env.yaml
run: playbooks/unit-test.yaml

- job:
Expand Down
33 changes: 26 additions & 7 deletions playbooks/setup-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,36 @@
args:
chdir: '{{ zuul.project.src_dir }}'

- name: Setup environment
become: yes
command:
cmd: systemd-tmpfiles --create
creates: /run/media

- name: Check versions of crucial packages
command: rpm -qa *kernel* *glibc* golang podman conmon containernetworking-plugins containers-common container-selinux crun runc fuse-overlayfs flatpak-session-helper
command: rpm -qa *kernel* *glibc* golang podman conmon containernetworking-plugins containers-common container-selinux crun runc fuse-overlayfs flatpak-session-helper patchelf

- name: Show podman versions
command: podman version

- name: Show podman debug information
command: podman info --debug

- name: Set up build directory
command: meson builddir
args:
chdir: '{{ zuul.project.src_dir }}'

- name: Build Toolbox
command: ninja -C builddir
args:
chdir: '{{ zuul.project.src_dir }}'
creates: builddir/src/toolbox

- name: Install Toolbox
become: yes
command: ninja -C builddir install
args:
chdir: '{{ zuul.project.src_dir }}'
creates: /usr/local/bin/toolbox

- name: Setup environment
become: yes
command:
cmd: systemd-tmpfiles --create
creates: /run/media
creates: /run/host
23 changes: 1 addition & 22 deletions playbooks/system-test.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,11 @@
---
- hosts: all

vars:
toolbox_bin: '/usr/local/bin/toolbox'

tasks:
- name: Set up build directory
command: meson builddir
args:
chdir: '{{ zuul.project.src_dir }}'

- name: Build Toolbox
command: ninja -C builddir
args:
chdir: '{{ zuul.project.src_dir }}'
creates: builddir/src/toolbox

- name: Install Toolbox
become: yes
command: ninja -C builddir install
args:
chdir: '{{ zuul.project.src_dir }}'
creates: '{{ toolbox_bin }}'

- name: Run system tests
command: bats --timing ./test/system
environment:
PODMAN: '/usr/bin/podman'
TOOLBOX: '{{ toolbox_bin }}'
TOOLBOX: '/usr/local/bin/toolbox'
args:
chdir: '{{ zuul.project.src_dir }}'
21 changes: 0 additions & 21 deletions playbooks/unit-test.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
---
- hosts: all
tasks:
- name: Install requirements
become: yes
package:
name:
- golang
- golang-github-cpuguy83-md2man
- ninja-build
- meson
- ShellCheck

- name: Set up build directory
command: meson builddir
args:
chdir: '{{ zuul.project.src_dir }}'

- name: Build Toolbox
command: ninja -C builddir
args:
chdir: '{{ zuul.project.src_dir }}'
creates: builddir/src/toolbox

- name: Test
command: ninja -C builddir test
args:
Expand Down

0 comments on commit 2a5337a

Please sign in to comment.