diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4099a4bae641d003e1058f3f964ff65924ac5f09..1b38e207c5050c63bee0c3f7c99d306590b38ebe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,33 +1,44 @@ +# variables in the GitLab CI/CD variables: + # GITLAB_TOKEN to support the semantic-release + # DOCKER_AUTH_CONFIG to support the usage of private docker images as job docker image + # TMPL_RELEASE_ENABLED to enable the semantic-release job + # TBC_NAMESPACE: smartdatalab/public/ci-cd-components + include: - - component: git.code.tecnalia.com/smartdatalab/public/ci-cd-components/gitlab-ci/extract@master + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/gitlab-ci/extract@master inputs: extract-script-job-tags: ["docker"] - - component: git.code.tecnalia.com/smartdatalab/public/ci-cd-components/gitlab-ci/validation@master + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/gitlab-ci/validation@master inputs: check-links-job-tags: ["docker"] tbc-check-job-tags: ["docker"] tbc-check-image: cicd-docker-dev.artifact.tecnalia.com/tbc-check:master gitlab-ci-lint-job-tags: ["docker"] - - component: git.code.tecnalia.com/smartdatalab/public/ci-cd-components/kicker/validation@master + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/kicker/validation@master inputs: kicker-validation-job-tags: ["docker"] schema-base-url: "https://git.code.tecnalia.com/api/v4/projects/smartdatalab%2Fpublic%2Fci-cd-components%2Fkicker/repository/files" - - component: git.code.tecnalia.com/smartdatalab/public/ci-cd-components/bash/gitlab-ci-bash@master + yajsv-image: "cicd-docker-dev.artifact.tecnalia.com/yajsv:latest" + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/bash/gitlab-ci-bash@master inputs: bash-shellcheck-job-tags: ["docker"] - - component: git.code.tecnalia.com/smartdatalab/public/ci-cd-components/semantic-release/gitlab-ci-semrel@master + shellcheck-files: "*.sh" + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/semantic-release/gitlab-ci-semrel@master inputs: semantic-release-job-tags: ["docker"] - -stages: - - build - - publish + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/gitleaks/gitlab-ci-gitleaks@master + inputs: + gitleaks-job-tags: ["docker"] variables: GITLAB_CI_FILES: "templates/gitlab-ci-sonar.yml" - BASH_SHELLCHECK_FILES: "*.sh" GIT_STRATEGY: clone +stages: + - build + - test + - publish + semantic-release: rules: # on production branch(es): auto if SEMREL_AUTO_RELEASE_ENABLED diff --git a/README.md b/README.md index a41f6da0370ce9bf22bc1ef3337384bd9b47e4d4..6b7cda3234882f00fedeff0af0377485fc7b4f19 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,16 @@ security vulnerabilities as early as possible. ## Usage -This template can be used both as a [CI/CD component](https://docs.gitlab.com/ee/ci/components/#use-a-component-in-a-cicd-configuration) or using the legacy [`include:project`](https://docs.gitlab.com/ee/ci/yaml/index.html#includeproject) syntax. +This template can be used both as a [CI/CD component](https://docs.gitlab.com/ee/ci/components/#use-a-component) or using the legacy [`include:project`](https://docs.gitlab.com/ee/ci/yaml/index.html#includeproject) syntax. ### Use as a CI/CD component -Add the following to your `gitlab-ci.yml`: +Add the following to your `.gitlab-ci.yml`: ```yaml include: # 1: include the component - - component: gitlab.com/to-be-continuous/sonar/gitlab-ci-sonar@4.2.3 + - component: $CI_SERVER_FQDN/to-be-continuous/sonar/gitlab-ci-sonar@4.2.3 # 2: set/override component inputs inputs: host-url: https://sonarqube.acme.host # âš this is only an example @@ -24,7 +24,7 @@ include: ### Use as a CI/CD template (legacy) -Add the following to your `gitlab-ci.yml`: +Add the following to your `.gitlab-ci.yml`: ```yaml include: @@ -116,9 +116,9 @@ With: ```yaml include: # main template - - component: gitlab.com/to-be-continuous/sonar/gitlab-ci-sonar@4.2.3 + - component: $CI_SERVER_FQDN/to-be-continuous/sonar/gitlab-ci-sonar@4.2.3 # Vault variant - - component: gitlab.com/to-be-continuous/sonar/gitlab-ci-sonar-vault@4.2.3 + - component: $CI_SERVER_FQDN/to-be-continuous/sonar/gitlab-ci-sonar-vault@4.2.3 inputs: # audience claim for JWT vault-oidc-aud: "https://vault.acme.host"