From d273edeccd97122de1caec74243d702a652cacb9 Mon Sep 17 00:00:00 2001 From: Andreas Geissler Date: Wed, 19 Oct 2022 17:49:04 +0200 Subject: [GITLAB] Initial content for gitlab project xtesting-onap Issue-ID: INT-2150 Signed-off-by: Andreas Geissler Change-Id: I6a429e2f661474fe54b13b6513eca64f13e99b50 --- roles/xtesting-healthcheck/tasks/launch.yaml | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 roles/xtesting-healthcheck/tasks/launch.yaml (limited to 'roles/xtesting-healthcheck/tasks/launch.yaml') diff --git a/roles/xtesting-healthcheck/tasks/launch.yaml b/roles/xtesting-healthcheck/tasks/launch.yaml new file mode 100644 index 0000000..5ec978b --- /dev/null +++ b/roles/xtesting-healthcheck/tasks/launch.yaml @@ -0,0 +1,50 @@ +--- +- block: + - name: ensure secret is present + community.kubernetes.k8s: + state: present + src: "{{ k8s_job__dir_path }}/s3-keys-{{ run_type }}.yaml" + kubeconfig: "{{ global_local_path }}/{{ kube_conf_file }}" + when: use_s3 | bool + + - name: start healthcheck job + community.kubernetes.k8s: + state: present + src: "{{ k8s_job__dir_path }}/healthcheck-{{ run_type }}.yaml" + kubeconfig: "{{ global_local_path }}/{{ kube_conf_file }}" + + - name: wait for end of job + community.kubernetes.k8s_info: + kind: Job + name: "integration-onap-{{ run_type }}" + namespace: "{{ onap_namespace }}" + register: job_info + until: (job_info.resources[0].status.succeeded is defined and + job_info.resources[0].status.succeeded == 1) or + (job_info.resources[0].status.failed is defined and + job_info.resources[0].status.failed >= 1) + retries: "{{ run_timeout }}" + delay: 1 + + - name: job has failed + ansible.builtin.fail: + msg: "The job has failed" + when: job_info.resources[0].status.failed is defined and + job_info.resources[0].status.failed >= 1 + + always: + - name: "save healthcheck {{ run_type }} results for artifacts" + ansible.posix.synchronize: + src: "{{ res_local_path }}/{{ run_tiers }}/{{ run_type }}" + use_ssh_args: true + dest: "./results/{{ run_tiers }}" + mode: pull + rsync_opts: + - "--exclude=output.xml" + ignore_errors: True + when: not use_s3 | bool + + - name: remove secret file + ansible.builtin.file: + path: "{{ k8s_job__dir_path }}/s3-keys-{{ run_type }}.yaml" + state: absent -- cgit 1.2.3-korg