setup: Add distro specific pre-setups
We need to have golang installed as a minimum to run the CI scripts. Add this as a distro-specific set of files, which then allows us to: - specialise in the future per distro if need be - note (fail gracefully) when we run on a new distro for the first time. Note, the distro specific parts are specifically added as a role as they will not pass the playbook linter if placed in the playbook tree (they are fragments, and playbooks are expected to be complete). Change-Id: Icb675c30a5ddcc5bdbebb7413808a58af4e838b7 Signed-off-by: Graham Whaley <graham.whaley@intel.com>
This commit is contained in:
parent
7000de896a
commit
532de2e94b
|
@ -1,18 +1,7 @@
|
|||
---
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Run Kata CI setup
|
||||
args:
|
||||
executable: /bin/bash
|
||||
chdir: "{{ zuul.project.src_dir }}"
|
||||
shell: |
|
||||
set -x
|
||||
# set a ${WORKSPACE}, so we look enough like a Jenkins env that
|
||||
# the Kata ci script will execute
|
||||
export WORKSPACE=$HOME
|
||||
export GOPATH=$HOME/go
|
||||
export CI=true
|
||||
export ZUUL=true
|
||||
export PATH=${GOPATH}/bin:/usr/sbin:$PATH
|
||||
.ci/install_go.sh -p -f
|
||||
.ci/setup.sh
|
||||
# the CI setup is placed out into a role, as the distro specific
|
||||
# file/task fragments do not pass the zuul yaml linter checks if
|
||||
# placed into the playbook tree.
|
||||
roles:
|
||||
- CI-setup
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Platform specific setup for kata CI.
|
|
@ -0,0 +1,23 @@
|
|||
- name: Run distribution specific tasks
|
||||
include_tasks: "{{ lookup('first_found', file_list) }}"
|
||||
vars:
|
||||
file_list:
|
||||
- "setup/{{ ansible_distribution }}.yaml"
|
||||
- "setup/{{ ansible_os_family }}.yaml"
|
||||
- "setup/default.yaml"
|
||||
|
||||
- name: Run Kata CI setup
|
||||
args:
|
||||
executable: /bin/bash
|
||||
chdir: "{{ zuul.project.src_dir }}"
|
||||
shell: |
|
||||
set -x
|
||||
# set a ${WORKSPACE}, so we look enough like a Jenkins env that
|
||||
# the Kata ci script will execute
|
||||
export WORKSPACE=$HOME
|
||||
export GOPATH=$HOME/go
|
||||
export CI=true
|
||||
export ZUUL=true
|
||||
export PATH=${GOPATH}/bin:/usr/sbin:$PATH
|
||||
.ci/install_go.sh -p -f
|
||||
.ci/setup.sh
|
|
@ -0,0 +1,9 @@
|
|||
- name: Install golang
|
||||
package:
|
||||
# It does not really matter which version we install, as long as it
|
||||
# can 'go get' the test repo, to then run the platform setup scripts,
|
||||
# which will then ensure we have the correct/necessary version of
|
||||
# golang installed.
|
||||
name: golang
|
||||
state: present
|
||||
become: yes
|
|
@ -0,0 +1,9 @@
|
|||
- name: Install golang
|
||||
package:
|
||||
# It does not really matter which version we install, as long as it
|
||||
# can 'go get' the test repo, to then run the platform setup scripts,
|
||||
# which will then ensure we have the correct/necessary version of
|
||||
# golang installed.
|
||||
name: golang
|
||||
state: present
|
||||
become: yes
|
|
@ -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.
|
Loading…
Reference in New Issue