zuul-jobs/roles/ensure-skopeo/tasks/Ubuntu-22.04.yaml
Ian Wienand 32be2d9067
ensure-skopeo: add install from upstream option
To test current buildx we need a later skopeo that understands the OCI
manifest formats.  c.f. the zuul-executor image updates with
Iab667a92a5b6e6f8591db2aa435a782913d9d34f.

A recent enough version (1.9) isn't packaged for any LTS distros.  So
add an upstream option, but it's only implemented (for now) on Jammy,
where we will test with it.

Change-Id: I206a3cbfb16575f409771d96c2b7e49929e61a49
2023-02-03 15:02:23 +11:00

50 lines
1.2 KiB
YAML

- name: Install skopeo from packages
when: not ensure_skopeo_install_from_upstream
package:
name:
- skopeo
- uidmap
state: present
become: yes
- name: Install skopeo from upstream
when: ensure_skopeo_install_from_upstream
block:
- name: Install dependencies
become: yes
package:
name:
- libgpgme-dev
- libassuan-dev
- libbtrfs-dev
- libdevmapper-dev
- pkg-config
- build-essential
- golang
state: present
- name: Clone upstream source
git:
repo: https://github.com/containers/skopeo
dest: '{{ ansible_user_dir }}/skopeo'
version: '{{ ensure_skopeo_install_from_upstream_version }}'
- name: Build skopeo
command: 'make bin/skopeo'
args:
chdir: '{{ ansible_user_dir }}/skopeo'
- name: Install binary
become: yes
copy:
src: '{{ ansible_user_dir}}/skopeo/bin/skopeo'
dest: '/usr/local/bin/skopeo'
owner: root
group: root
mode: '0755'
remote_src: yes
- name: Test binary
command: '/usr/local/bin/skopeo --version'