-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare-operator-metadata.yml
46 lines (40 loc) · 1.6 KB
/
prepare-operator-metadata.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
# Playbook parameters:
#
# operator_work_dir: Operator_work_dir is essentially empty folder
# operator_dir: where the operator metadata is unziped and copied
# using operator-courier
# work_dir: Work dir is place where the operator data is generated
# defaults to workspace
# jq_bin_path: Path where the json query binary is installed
# yq_bin_path: Path to yaml query binary is installed
# testing_bin_path: Path were all the testing binaries exists
# current_channel: Operator channel determined from the metadata
- name: "Prepare operator metadata for usage with the operator testing pipeline"
hosts: all
become: false
gather_facts: false
vars:
run_upstream: false
operator_work_dir: "/home/jenkins/agent/test-operator"
operator_dir: "/tmp/test"
work_dir: "{{ lookup('env', 'WORKSPACE') }}"
jq_bin_path: "/usr/bin/jq"
yq_bin_path: "/usr/local/bin/yq"
testing_bin_path: "/usr/local/bin"
current_channel: '' # Added to avoid a bug with undefined variables
tasks:
- name: "Set variables for operator_work_dir and operator_dir"
set_fact:
operator_work_dir: >
"{{ operator_work_dir |
default('/home/jenkins/agent/test-operator')}}"
operator_dir: "{{ operator_dir | default('/tmp/test') }}"
- name: >
"Run operator-courier nest to
copy the operator metadata in
nested format to the work dir"
shell: "operator-courier nest {{ operator_dir }} {{ operator_work_dir }}"
- name: "Parse operator metadata needed to run the tests"
include_role:
name: parse_operator_metadata