Skip to content
Snippets Groups Projects
Commit 24dc7b5c authored by Gioacchino Vino's avatar Gioacchino Vino
Browse files

Merge branch 'debug_paas_ci' into 'main'

Debug paas ci

See merge request !86
parents 1ffef5cb 52913011
No related branches found
No related tags found
1 merge request!86Debug paas ci
......@@ -3,6 +3,5 @@
paas_ci_orchestrator_url: https://paas.cloud.infn.it/orchestrator
paas_ci_iam_group: admins/cicd
paas_ci_workdir: "{{ lookup('env','WORKSPACE') }}"
paas_ci_scan_script_path: "{{ paas_ci_workdir }}/scan.py"
n_timeout_ticks: 60
endpoints_to_scan: None
\ No newline at end of file
......@@ -4,8 +4,8 @@ import logging
import json
from sys import argv, exit
import os
import gvm_library
import utilities
import scan_gvm_library as gvm_library
import scan_utilities as utilities
import argparse
### GVM Options ###
......
File moved
File moved
......@@ -9,35 +9,60 @@
- name: Copy scan script
copy:
src: files/scan.py
dest: "{{ paas_ci_scan_script_path }}"
dest: "{{ paas_ci_workdir + '/scan.py' }}"
- name: Copy utilities module
copy:
src: files/utilities.py
dest: "{{ paas_ci_scan_script_path }}"
dest: "{{ paas_ci_workdir + '/scan_utilities.py' }}"
- name: Copy gvm_library module
copy:
src: files/gvm_library.py
dest: "{{ paas_ci_scan_script_path }}"
dest: "{{ paas_ci_workdir + '/scan_gvm_library.py' }}"
- name: Adding execution permission to scan script
file:
dest: "{{ paas_ci_scan_script_path + '/scan.py' }} "
dest: "{{ paas_ci_workdir + '/scan.py' }}"
mode: a+x
- name: Show dep json file
debug:
msg: "{{lookup('file', item.path)}}"
with_items: "{{ paas_ci_workdir + '/dep.json'}}"
msg: "{{ lookup('file', item.path) }}"
with_items: "{{ paas_ci_workdir + '/dep.json' }}"
- name: Load depdep log
command: cat "{{ paas_ci_workdir + '/dep.json' }}"
register: dep_json
- name: import depdep_log
set_fact:
imported_depdep_log: "{{ dep_json.stdout }}"
- name: Show depdep log
debug:
var: imported_depdep_log
- name: Show BEFORE paas_ci_test.endpoints_to_scan log
debug:
var: paas_ci_test.endpoints_to_scan
- name: Fail if "bar" is undefined
set_fact:
paas_ci_test.endpoints_to_scan: "None"
when: paas_ci_test.endpoints_to_scan is undefined
- name: Show AFTER paas_ci_test.endpoints_to_scan log
debug:
var: paas_ci_test.endpoints_to_scan
- name: Run scan
command: "{{ paas_ci_scan_script_path }}/scan.py --endpoint-keys {{ paas_ci_test.endpoints_to_scan }} --dep-json {{ paas_ci_workdir + '/dep.json'}} --output-dir {{ paas_ci_workdir }}"
command: "{{ paas_ci_workdir + '/scan.py' }} --endpoint-keys {{ paas_ci_test.endpoints_to_scan }} --dep-json {{ paas_ci_workdir + '/dep.json'}} --output-dir {{ paas_ci_workdir }}"
register: scan_output
- name: Scan logs
debug:
msg: "{{lookup('file', item.path)}}"
msg: "{{ lookup('file', item.path) }}"
with_items: "{{ paas_ci_workdir + 'scan.log' }}"
- name: Show scan output
......@@ -46,12 +71,12 @@
- name: Find report files
find:
paths: "{{paas_ci_workdir}}"
paths: "{{ paas_ci_workdir }}"
patterns: '*infn.it-report.txt'
register: report_files
- name: read summary report file
shell: cat "{{ paas_ci_workdir + '/summary-report.json'}}"
shell: cat "{{ paas_ci_workdir + '/summary-report.json' }}"
register: summary_report
- name: import summary_report
......@@ -60,12 +85,12 @@
- name: Show reports
debug:
msg: "{{lookup('file', item.path)}}"
with_items: "{{report_files.files}}"
msg: "{{ lookup('file', item.path) }}"
with_items: "{{ report_files.files }}"
when: summary_report_json.global == 'NOK'
- name: Load scans log
command: cat "{{ paas_ci_workdir + '/scans.log'}}"
command: cat "{{ paas_ci_workdir + '/scan.log' }}"
register: scans_log
when: summary_report_json.global == 'NOK'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment