diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index da74782bfec4a95096fdcc5c141cbec5b38c8baf..cf9cce016aa71b400f13ca8362c7dbd139c6455a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,37 +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"] - - component: git.code.tecnalia.com/smartdatalab/public/ci-cd-components/gitleaks/gitlab-ci-gitleaks@master + - component: $CI_SERVER_FQDN/$TBC_NAMESPACE/gitleaks/gitlab-ci-gitleaks@master inputs: gitleaks-job-tags: ["docker"] +variables: + GITLAB_CI_FILES: "templates/gitlab-ci-maven.yml" + GIT_STRATEGY: clone + stages: - build - test - publish -variables: - GITLAB_CI_FILES: "templates/gitlab-ci-maven.yml" - BASH_SHELLCHECK_FILES: "*.sh" - GIT_STRATEGY: clone - semantic-release: rules: # on production branch(es): auto if SEMREL_AUTO_RELEASE_ENABLED diff --git a/README.md b/README.md index 4c9e376a3d21986ad7e42d515f097286705dbe6f..d3c5f3e6cc99ac5fdd9fc921a5f7e39cbac4587e 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,17 @@ This project implements a GitLab CI/CD template to build, test and analyse your ## 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) +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/maven/gitlab-ci-maven@3.11.1 + - component: $CI_SERVER_FQDN/to-be-continuous/maven/gitlab-ci-maven@3.11.1 # 2: set/override component inputs inputs: # ⚠ 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: @@ -324,7 +324,7 @@ Your Maven repository may require authentication credentials to publish artifact You may handle them in the following ways: -1. define all required credentials as :lock: [project variables](https://docs.gitlab.com/ee/ci/variables/#add-a-cicd-variable-to-a-project), +1. define all required credentials as :lock: [project variables](https://docs.gitlab.com/ee/ci/variables/#for-a-project), 2. make sure your `pom.xml` (or ancestor) [declares your `<repository>` and `<snapshotRepository>` with server **id**s in a `<distributionManagement>` section](https://maven.apache.org/pom.html#repository), 3. in your `${MAVEN_CFG_DIR}/settings.xml` file, [define the repository servers credentials in the `<servers>` section](https://maven.apache.org/settings.html#Servers) using the `${env.VARIABLE}` pattern—will be automatically evaluated and replaced by Maven. @@ -536,7 +536,7 @@ All authentication methods should use masked GitLab environment variables. ```yaml include: # main template - - component: gitlab.com/to-be-continuous/maven/gitlab-ci-maven@3.11.1 + - component: $CI_SERVER_FQDN/to-be-continuous/maven/gitlab-ci-maven@3.11.1 # Jib is implemented as an extension to Maven, and uses supporting features of the TBC Maven template - - component: gitlab.com/to-be-continuous/maven/gitlab-ci-maven-jib@3.11.1 + - component: $CI_SERVER_FQDN/to-be-continuous/maven/gitlab-ci-maven-jib@3.11.1 ```