Add fedora 28 support to kata runsh job

This refactors the kata runsh job a bit to push pre.yaml setup into a
role so that we can more easily include distro specific tasks. This
allows us to have differing ubuntu and fedora setup in a readable
manner.

Change-Id: I06029f49a81d0a4262c58e8f45a1414efa43d920
This commit is contained in:
Clark Boylan 2018-06-22 14:42:07 -07:00
parent 34c90e51b5
commit 0356342edb
8 changed files with 137 additions and 64 deletions

View File

@ -1,64 +1,3 @@
- hosts: all
tasks:
- name: Install build-essential
package:
name: build-essential
state: present
become: yes
- name: Install golang
package:
name: golang-1.10
state: present
become: yes
- name: Make sure sources.list.d exists
file:
path: /etc/apt/sources.list.d
owner: root
group: root
mode: 0755
state: directory
become: yes
# Install docker because .ci/setup.sh installs a version that is too old
# to pass CI testing with.
# TODO have .ci/setup.sh do the right thing
- name: Install apt-transport-https
package:
name: apt-transport-https
state: present
become: yes
- name: Install ca-certificates
package:
name: ca-certificates
state: present
become: yes
- name: Install software-properties-common
package:
name: software-properties-common
state: present
become: yes
- name: Add docker-ce repo
args:
executable: /bin/bash
shell: |
set -x
curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
become: yes
- name: Install docker-ce
package:
name: docker-ce
state: present
become: yes
- name: Run kata setup.sh
args:
executable: /bin/bash
chdir: "{{ zuul.project.src_dir }}"
shell: |
set -x
export PATH=$PATH:/usr/lib/go-1.10/bin
export CI=true
export GOPATH=$HOME
.ci/setup.sh
roles:
- kata-setup

View File

@ -6,7 +6,9 @@
chdir: "{{ zuul.project.src_dir }}"
shell: |
set -x
export PATH=$PATH:/usr/lib/go-1.10/bin
if [ -d '/usr/lib/go-1.10/bin' ] ; then
export PATH=$PATH:/usr/lib/go-1.10/bin
fi
export CI=true
export GOPATH=$HOME
.ci/run.sh

View File

@ -0,0 +1 @@
Platform specific setup for kata CI.

View File

@ -0,0 +1,20 @@
- name: Install distribution specific package needs
include: "{{ item }}"
static: no
with_first_found:
- "setup/{{ ansible_distribution }}.yaml"
- "setup/{{ ansible_os_family }}.yaml"
- "setup/default.yaml"
- name: Run kata setup.sh
args:
executable: /bin/bash
chdir: "{{ zuul.project.src_dir }}"
shell: |
set -x
if [ -d '/usr/lib/go-1.10/bin' ] ; then
export PATH=$PATH:/usr/lib/go-1.10/bin
fi
export CI=true
export GOPATH=$HOME
.ci/setup.sh

View File

@ -0,0 +1,47 @@
- name: Install make
package:
name: make
state: present
become: yes
- name: Install automake
package:
name: automake
state: present
become: yes
- name: Install gcc
package:
name: gcc
state: present
become: yes
- name: Install g++
package:
name: gcc-c++
state: present
become: yes
- name: Install golang
package:
name: golang
state: present
become: yes
# Install docker because .ci/setup.sh installs a version that is too old
# to pass CI testing with.
# TODO have .ci/setup.sh do the right thing
- name: Install dnf-plugins-core
package:
name: dnf-plugins-core
state: present
become: yes
- name: Add docker-ce repo
args:
executable: /bin/bash
shell: |
set -x
dnf config-manager --add-repo "https://download.docker.com/linux/fedora/docker-ce.repo"
dnf makecache
become: yes
- name: Install docker-ce
package:
name: docker-ce
state: present
become: yes

View File

@ -0,0 +1,51 @@
- name: Install build-essential
package:
name: build-essential
state: present
become: yes
- name: Install golang
package:
name: golang-1.10
state: present
become: yes
- name: Make sure sources.list.d exists
file:
path: /etc/apt/sources.list.d
owner: root
group: root
mode: 0755
state: directory
become: yes
# Install docker because .ci/setup.sh installs a version that is too old
# to pass CI testing with.
# TODO have .ci/setup.sh do the right thing
- name: Install apt-transport-https
package:
name: apt-transport-https
state: present
become: yes
- name: Install ca-certificates
package:
name: ca-certificates
state: present
become: yes
- name: Install software-properties-common
package:
name: software-properties-common
state: present
become: yes
- name: Add docker-ce repo
args:
executable: /bin/bash
shell: |
set -x
curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
become: yes
- name: Install docker-ce
package:
name: docker-ce
state: present
become: yes

View File

@ -0,0 +1,5 @@
- name: Warn about unsupported distribution
debug:
msg: >
WARNING: {{ ansible_distribution }} not supported for Kata CI under Zuul.
You can add support to this directory if desired.

View File

@ -1455,3 +1455,11 @@
nodes:
- name: ubuntu-xenial
label: ubuntu-xenial-vexxhost
- job:
name: kata-runsh-fedora-28
parent: kata-runsh
nodeset:
nodes:
- name: fedora-28
label: fedora-28-vexxhost