From 0683b75dc864633077d48e984c54c506a6190561 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Fri, 2 Jun 2023 13:30:05 +0100 Subject: [PATCH] [zuul] Add in base job for testing with zuul --- .zuul.yaml | 56 ++++++++++++++++++++++++++++++++++++++++++++++- ci/build_stf.yml | 14 ++++++++++++ ci/deploy_stf.yml | 8 +++++++ ci/prepare.yml | 13 +++++++++++ ci/test_stf.yml | 8 +++++++ 5 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 ci/build_stf.yml create mode 100644 ci/deploy_stf.yml create mode 100644 ci/prepare.yml create mode 100644 ci/test_stf.yml diff --git a/.zuul.yaml b/.zuul.yaml index 28a9499a6..5470e0a8c 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,6 +1,60 @@ --- +- job: + name: stf-base + # defined in: https://review.rdoproject.org/cgit/config/tree/zuul.d/_jobs-crc.yaml + parent: base-simple-crc + # need to set cluster-monitoring + abstract: true + description: | + Create a CRC instance that's configured for STF + # irrelevant-files + roles: # adds in dependent roles i.e. put it in the role path + - zuul: github.com/openstack-k8s-operators/ci-framework + # These are the additional repos that zuul will clone + required-projects: + - openstack-k8s-operators/ci-framework + # requires: # defines a resource that needs to be available e.g. a content-provide job will provide a resource + # dependencies: # list a job that needs to run successfully for this one + # + nodeset: centos-9-crc-xxl + vars: + # vars for base-simple-crc + crc_config_cluster_monitoring: true + # crc_parameters: # Pass vars to crc cli https://review.rdoproject.org/cgit/config/tree/playbooks/crc/simple-start.yaml#n30 + + # need a base job here, for now to request the specific versions of OCP + + # content provider job that provides stf-15. + # MIGHT need OCP + + # all jobs would depend on a combo of the stf and ocp content providers + + # this is the one to use +- job: + name: stf-crc-latest + parent: stf-base + description: | + Build, deploy and test STF + pre-run: + - ci/prepare.yml + run: + - ci/build_stf.yml + - ci/deploy_stf.yml + - ci/test_stf.yml + +#stf-1.5-ocp-4.10 +# parent: stf-base +# dependencies: [make-ocp-4.10] +# requires: +# - "ocp-4.10" +# +#stf-1.5-ocp-4.12 +# parent: stf-base +#stf-1.5-ocp-pre-release +# parent: stf-base + - project: name: infrawatch/service-telemetry-operator github-check: jobs: - - noop + - stf-crc-latest diff --git a/ci/build_stf.yml b/ci/build_stf.yml new file mode 100644 index 000000000..821ee14f0 --- /dev/null +++ b/ci/build_stf.yml @@ -0,0 +1,14 @@ +--- +hosts: controller +tasks: + - name: "Build STF containers" + when: build_stf | default(True) + ansible.builtin.import_role: + name: build/stf-run-ci + vars: + __deploy_stf: false + __local_build_enabled: true + __service_telemetry_snmptraps_enabled: "true" + __service_telemetry_storage_ephemeral_enabled": "true" + __working_branch: master + diff --git a/ci/deploy_stf.yml b/ci/deploy_stf.yml new file mode 100644 index 000000000..96c605631 --- /dev/null +++ b/ci/deploy_stf.yml @@ -0,0 +1,8 @@ +--- +- hosts: controller + tasks: + - name: "Deploy STF object" + ansible.builtin.shell: + cmd: | + OCP_PROJECT=service-telemetry VALIDATION_SCOPE=use_redhat ./build/validate_deployment.sh + chdir: "{{ ansible_user_dir }}/src/github.com/infrawatch/service-telemetry-operator/" diff --git a/ci/prepare.yml b/ci/prepare.yml new file mode 100644 index 000000000..5cd0e8a89 --- /dev/null +++ b/ci/prepare.yml @@ -0,0 +1,13 @@ +--- +- hosts: controller + tasks: + #- name: Clone upstream + + - name: Log into the cluster + ansible.builtin.import_role: + name: rhol_crc + tasks_from: add_crc_creds.yml + - name: Create project + shell: + cmd: | + oc new-project service-telemetry diff --git a/ci/test_stf.yml b/ci/test_stf.yml new file mode 100644 index 000000000..e1c6f23d6 --- /dev/null +++ b/ci/test_stf.yml @@ -0,0 +1,8 @@ +--- +- hosts: controller + tasks: + - name: "Run STF smoketests" + ansible.builtin.shell: + cmd: | + OCP_PROJECT=${namespace} ./tests/smoketest/smoketest.sh + chdir: "{{ ansible_user_dir }}/src/github.com/infrawatch/service-telemetry-operator/"