Loading .gitlab-ci.yml +30 −8 Original line number Diff line number Diff line Loading @@ -5,21 +5,40 @@ stages: - deploy include: - remote: 'https://jobs.r2devops.io/links_checker.yml' - remote: 'https://jobs.r2devops.io/1.4.0/mkdocs.yml?scope=0.yml' - remote: 'https://jobs.r2devops.io/0.3.0/pages.yml?scope=0.yml' ci_linter: image: golang:1.15.2-alpine3.12 stage: static_tests image: name: alpine/httpie:2.4.0 entrypoint: [""] variables: GITLAB_CI_LINT_URL: "https://gitlab.com/api/v4/ci/lint?include_merged_yaml=true" JOB_FILES_EXTENSION: ".yml" script: - apk add --no-cache git - go get gitlab.com/orobardet/gitlab-ci-linter - apk add --no-cache jq - mkdir ci_linter_reports - for JOB_PATH in jobs/*; do - echo "Start checking ${JOB_PATH}/${JOB} using Gitlab CI linter API" - JOB=$(basename ${JOB_PATH}) - gitlab-ci-linter --verbose ${JOB_PATH}/${JOB}.yml - jq --null-input --arg yaml "$(cat ${JOB_PATH}/${JOB}${JOB_FILES_EXTENSION})" '.content=$yaml' | http --print 'b' --check-status "$GITLAB_CI_LINT_URL" Content-Type:"application/json" PRIVATE-TOKEN:${API_TOKEN} > ci_linter_reports/${JOB}.json - if [ $(jq -r '.status' ci_linter_reports/${JOB}.json) == "valid" ]; then - echo "👍 job ${JOB_PATH}/${JOB} is valid" - else - echo "👎 job ${JOB_PATH}/${JOB} is invalid" - jq '.' ci_linter_reports/${JOB}.json - exit 1 - fi - done artifacts: expose_as: "job_ci_lint" paths: - ci_linter_reports/ when: always structure: job_structure: image: python:3.9.1-alpine stage: static_tests variables: Loading @@ -31,9 +50,9 @@ structure: script: - pipenv run python3 tools/job_structure/job_structure.py artifacts: expose_as: "job_structure" paths: - ${JOB_LOGFILE} expire_in: 30 days when: always job_customs: Loading @@ -48,10 +67,11 @@ job_customs: script: - pipenv run python3 tools/job_customs/job_customs.py artifacts: expose_as: "jobs_customs" paths: - ${JOB_LOGFILE} scan_images_dep: job_image_scan: image: docker:19.03 stage: static_tests services: Loading Loading @@ -115,9 +135,10 @@ scan_images_dep: paths: - "$TRIVY_CACHE_DIR" artifacts: expose_as: "job_image_scan" paths: - "${JOB_LOGFILE}" - "${OUTPUT_DIR}/*.xml" - "${OUTPUT_DIR}" reports: junit: - "${OUTPUT_DIR}/*.xml" Loading @@ -138,6 +159,7 @@ job_labels: script: - pipenv run python3 tools/job_labels/job_labels.py artifacts: expose_as: "job_labels" paths: - ${JOB_LOGFILE} expire_in: 30 days Loading jobs/docker_build/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ remote registry. The build part is done using to containerize your application 2. Choose a version in [version list](#changelog) 3. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting started](/getting-started)). Example: started](/use-the-hub)). Example: ```yaml include: - remote: 'https://jobs.r2devops.io/docker_build.yml' Loading jobs/doxygen/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ Other languages can be supported with additional code. 1. Ensure that your source code is documenting using [Doxygen syntax](https://www.doxygen.nl/manual/docblocks.html){:target="_blank"} 2. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting started](/getting-started)). Example: started](/use-the-hub)). Example: ```yaml include: Loading jobs/gitleaks/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ repos. As it written in go, it is much faster than most of the 1. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting started](/getting-started)). Example: started](/use-the-hub/)). Example: ```yaml include: Loading jobs/links_checker/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ In its default state, this job will analyze your whole project for eligible file 1. Have `.md`, `.html` or `.htm` files in your project 2. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting started](/getting-started)). Example: started](/use-the-hub)). Example: ```yaml include: Loading Loading
.gitlab-ci.yml +30 −8 Original line number Diff line number Diff line Loading @@ -5,21 +5,40 @@ stages: - deploy include: - remote: 'https://jobs.r2devops.io/links_checker.yml' - remote: 'https://jobs.r2devops.io/1.4.0/mkdocs.yml?scope=0.yml' - remote: 'https://jobs.r2devops.io/0.3.0/pages.yml?scope=0.yml' ci_linter: image: golang:1.15.2-alpine3.12 stage: static_tests image: name: alpine/httpie:2.4.0 entrypoint: [""] variables: GITLAB_CI_LINT_URL: "https://gitlab.com/api/v4/ci/lint?include_merged_yaml=true" JOB_FILES_EXTENSION: ".yml" script: - apk add --no-cache git - go get gitlab.com/orobardet/gitlab-ci-linter - apk add --no-cache jq - mkdir ci_linter_reports - for JOB_PATH in jobs/*; do - echo "Start checking ${JOB_PATH}/${JOB} using Gitlab CI linter API" - JOB=$(basename ${JOB_PATH}) - gitlab-ci-linter --verbose ${JOB_PATH}/${JOB}.yml - jq --null-input --arg yaml "$(cat ${JOB_PATH}/${JOB}${JOB_FILES_EXTENSION})" '.content=$yaml' | http --print 'b' --check-status "$GITLAB_CI_LINT_URL" Content-Type:"application/json" PRIVATE-TOKEN:${API_TOKEN} > ci_linter_reports/${JOB}.json - if [ $(jq -r '.status' ci_linter_reports/${JOB}.json) == "valid" ]; then - echo "👍 job ${JOB_PATH}/${JOB} is valid" - else - echo "👎 job ${JOB_PATH}/${JOB} is invalid" - jq '.' ci_linter_reports/${JOB}.json - exit 1 - fi - done artifacts: expose_as: "job_ci_lint" paths: - ci_linter_reports/ when: always structure: job_structure: image: python:3.9.1-alpine stage: static_tests variables: Loading @@ -31,9 +50,9 @@ structure: script: - pipenv run python3 tools/job_structure/job_structure.py artifacts: expose_as: "job_structure" paths: - ${JOB_LOGFILE} expire_in: 30 days when: always job_customs: Loading @@ -48,10 +67,11 @@ job_customs: script: - pipenv run python3 tools/job_customs/job_customs.py artifacts: expose_as: "jobs_customs" paths: - ${JOB_LOGFILE} scan_images_dep: job_image_scan: image: docker:19.03 stage: static_tests services: Loading Loading @@ -115,9 +135,10 @@ scan_images_dep: paths: - "$TRIVY_CACHE_DIR" artifacts: expose_as: "job_image_scan" paths: - "${JOB_LOGFILE}" - "${OUTPUT_DIR}/*.xml" - "${OUTPUT_DIR}" reports: junit: - "${OUTPUT_DIR}/*.xml" Loading @@ -138,6 +159,7 @@ job_labels: script: - pipenv run python3 tools/job_labels/job_labels.py artifacts: expose_as: "job_labels" paths: - ${JOB_LOGFILE} expire_in: 30 days Loading
jobs/docker_build/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ remote registry. The build part is done using to containerize your application 2. Choose a version in [version list](#changelog) 3. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting started](/getting-started)). Example: started](/use-the-hub)). Example: ```yaml include: - remote: 'https://jobs.r2devops.io/docker_build.yml' Loading
jobs/doxygen/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ Other languages can be supported with additional code. 1. Ensure that your source code is documenting using [Doxygen syntax](https://www.doxygen.nl/manual/docblocks.html){:target="_blank"} 2. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting started](/getting-started)). Example: started](/use-the-hub)). Example: ```yaml include: Loading
jobs/gitleaks/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ repos. As it written in go, it is much faster than most of the 1. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting started](/getting-started)). Example: started](/use-the-hub/)). Example: ```yaml include: Loading
jobs/links_checker/README.md +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ In its default state, this job will analyze your whole project for eligible file 1. Have `.md`, `.html` or `.htm` files in your project 2. Add the corresponding URL to your `.gitlab-ci.yml` file (see [Getting started](/getting-started)). Example: started](/use-the-hub)). Example: ```yaml include: Loading