Commit 06a1cd0e authored by Thomas Boni's avatar Thomas Boni
Browse files

split jobs & pipelines

parent f305d07e
Loading
Loading
Loading
Loading
+36 −3
Original line number Diff line number Diff line
@@ -180,7 +180,8 @@ Note:

Build project as Docker image and deploy it on Kubernetes using Helm.

* File: https://gitlab.com/go2scale/jobs/raw/2020-02-24_1/kubernetes.gitlab-ci.yml
Specifications
* File: https://gitlab.com/go2scale/jobs/raw/<TAG>/pipelines/kubernetes.gitlab-ci.yml
* Integration
  * [quality check](#quality)
  * [build](#build)
@@ -193,7 +194,12 @@ Build project as Docker image and deploy it on Kubernetes using Helm.

Auto-detect file in repo and run all [coala](https://coala.io) relevant linters on it.

* File: https://gitlab.com/go2scale/jobs/raw/2020-02-24_1/kubernetes.gitlab-ci.yml
How to use it
* Variables:
  * **TODO:** put variables from https://gitlab.com/go2scale/dockerfiles/quality-check here

Specifications
* File: https://gitlab.com/go2scale/jobs/raw/<TAG>/jobs/quality_check.gitlab-ci.yml
* Publications:
  * Full report as artifact
  * Short report in merge request and job logs
@@ -205,4 +211,31 @@ Auto-detect file in repo and run all [coala](https://coala.io) relevant linters
*Work in progress...*

### Helm
*Work in progress...*

Deploy on your kubernetes cluster using Helm charts.
* In issue branch: review environment
* In master branch: staging environment
* In master branch: production environment (manual)

Specifications
* File: https://gitlab.com/go2scale/jobs/raw/<TAG>/jobs/helm.gitlab-ci.yml
* Publications: *TODO*
* Image:
  * Repository: https://gitlab.com/go2scale/dockerfiles/helm
  * Documentation: https://go2scale.gitlab.io/dockerfiles/helm

How to use it
* Chart and values files must be in repo, see Variables section
* Use [helm secrets](https://github.com/futuresimple/helm-secrets) to encrypt/decrypt secrets values files
* Values files must be named like `<ENV>.yaml` for clear text and `secrets.<ENV>.yaml` for encrypted
* Variables:
  * `REVIEW_DISABLE`: disable review deployment
  * `STAGING_DISABLE`: disable staging deployment
  * `PRODUCTION_DISABLE`: disable production deployment
  * `CHART_PATH`: path of helm chart to use. Default: `/charts/$CI_PROJECT_NAME`
  * `VALUES_PATH`: path of values files to use. Default: `./conf/values`
* Secret variables:
  * `PGP_PUBLIC`: public PGP key to decrypt secrets values. Use `file` type.
  * `PGP_PRIVATE`: private PGP key to decrypt secrets values. Use `file` type.

+3 −40
Original line number Diff line number Diff line
# ############################
# Go2Scale DevSecOps template
# ############################
#
# Some variables must be defined in your CI/CD settings
# (https://docs.gitlab.com/ee/ci/variables/#creating-a-custom-environment-variable):
#   * DOCKER_AUTH_CONFIG: docker auth configuration to access Go2Scale images
#   * BOT_TOKEN: Secret token of bot user to interact with Gitlab API
#   * TEMPLATES_REPO_PASSWORD: If needed, secret password (or token)
#     with read access to templates repository

image: alpine:latest

variables:
  DOCKER_DRIVER: overlay2
  DOCKER_TLS_CERTDIR: ""  # https://gitlab.com/gitlab-org/gitlab-runner/issues/4501
  # Go2Scale global variables
  BOT_USER_ID: '' # TODO: use your own BOT ID
  TEMPLATES_REPO_URL: 'gitlab.com/go2scale/templates.git'
  GITLAB_URL: $CI_SERVER_URL

stages:
  - code_level
  - build
  - review
  - application_level
  - staging
  - production
  - performance

include:
  # Gitlab AutoDevops
  - template: Jobs/Build.gitlab-ci.yml
  - template: Security/Container-Scanning.gitlab-ci.yml
  # Go2Scale DevSecOps
  - remote: https://gitlab.com/go2scale/jobs/raw/2020-02-24_1/quality_check.gitlab-ci.yml

container_scanning:
  stage: review
# "Helm" jobs
# See https://gitlab.com/go2scale/jobs/ for more informations

.helm:
  image: registry.gitlab.com/go2scale/dockerfiles/helm:v0.2.2
@@ -95,7 +58,7 @@ deploy_stage:
    - master
  except:
    variables:
      - $STAGE_DISABLE
      - $STAGING_DISABLE

#test_production:
#  extends: deploy_production
+42 −0
Original line number Diff line number Diff line
# ############################
# Go2Scale DevSecOps template
# ############################
#
# Some variables must be defined in your CI/CD settings
# (https://docs.gitlab.com/ee/ci/variables/#creating-a-custom-environment-variable):
#   * DOCKER_AUTH_CONFIG: docker auth configuration to access Go2Scale images
#   * BOT_TOKEN: Secret token of bot user to interact with Gitlab API
#   * TEMPLATES_REPO_PASSWORD: If needed, secret password (or token)
#     with read access to templates repository
#   * PGP_PUBLIC: PGP public key. Use type "file"
#   * PGP_PRIVATE: PGP private key. Use type "file"

image: alpine:latest

variables:
  DOCKER_DRIVER: overlay2
  DOCKER_TLS_CERTDIR: ""  # https://gitlab.com/gitlab-org/gitlab-runner/issues/4501
  # Go2Scale global variables
  BOT_USER_ID: '' # TODO: use your own BOT ID
  TEMPLATES_REPO_URL: 'gitlab.com/go2scale/templates.git'
  GITLAB_URL: $CI_SERVER_URL

stages:
  - code_level
  - build
  - review
  - application_level
  - staging
  - production
  - performance

include:
  # Gitlab AutoDevops
  - template: Jobs/Build.gitlab-ci.yml
  - template: Security/Container-Scanning.gitlab-ci.yml
  # Go2Scale DevSecOps
  - remote: https://gitlab.com/go2scale/jobs/raw/2020-02-29_1/jobs/quality_check.gitlab-ci.yml
  - remote: https://gitlab.com/go2scale/jobs/raw/2020-02-29_1/jobs/helm.gitlab-ci.yml

container_scanning:
  stage: review