From f8fa4cdbfadc3628a33752ff47cb2d96e26e5c5d Mon Sep 17 00:00:00 2001 From: DeveloperDurp Date: Sun, 21 May 2023 08:11:04 -0500 Subject: [PATCH] updates --- jobs/temp | 0 scripts/render-job-templates.sh | 4 ++-- templates/build-container.tpl.yml | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 jobs/temp diff --git a/jobs/temp b/jobs/temp new file mode 100644 index 0000000..e69de29 diff --git a/scripts/render-job-templates.sh b/scripts/render-job-templates.sh index bce19d2..a873bd1 100644 --- a/scripts/render-job-templates.sh +++ b/scripts/render-job-templates.sh @@ -33,11 +33,11 @@ cat job-templates.tpl.yml >> job-templates.yml for template in templates/*.tpl.yml do export pipeline=$(basename $template | sed "s/.tpl//") - cat $template > pipelines/$pipeline + cat $template > jobs/$pipeline ./yq -i '(.[] | select(keys | .[] | select(tag == "!!str") | test("^(before_|after_|)script$")) | ."*script") ref $scripts | ($scripts | .. | select(. == "./scripts/*.sh")) |= (load(. + ".yml") | .[] style="") | ($scripts | .[] | select(type == "!reference")) |= ([.] | . style="flow") | ($scripts | select(type == "!!seq")) |= flatten(1) | explode . - ' pipelines/$pipeline + ' jobs/$pipeline done diff --git a/templates/build-container.tpl.yml b/templates/build-container.tpl.yml index 45b59a2..e01b06d 100644 --- a/templates/build-container.tpl.yml +++ b/templates/build-container.tpl.yml @@ -12,6 +12,23 @@ version: reports: dotenv: version.env +sonarcloud-check: + stage: .pre + variables: + SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache + GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task + image: + name: sonarsource/sonar-scanner-cli:latest + entrypoint: [""] + cache: + key: "${CI_JOB_NAME}" + paths: + - .sonar/cache + script: + - sonar-scanner + rules: + - if: $CI_COMMIT_REF_NAME == 'main' || $CI_PIPELINE_SOURCE == 'merge_request_event' + build-container: image: registry.durp.info/docker:20.10.17 variables: