# CI / CD

Continuous integration and Continuous Delivery are the processes in which our development team involves frequent code changes while ensuring that it does not impact any changes made by developers working parallelly.

# Gitlab

Gitlab offers a lot of options for CI/CD

# Basic Standard CI/CD

The following yaml file contains 3 stages that help us achieve:

  1. test: Automatic build of the project when a new MR is created.
  2. release: Automatically generate update the changelog and package version when a new commit is made on develop
  3. deploy: Automatically build and deploy when a commit is made on master
image: node:12.13.0-alpine

variables:
  CI_NAME: "PLUSTEAM"
  CI_EMAIL: "development@plusteam.tech"

stages:
  - test
  - release
  - deploy

test:
  stage: test
  only:
    - merge_requests
  script:
    - npm install
    - npm run build

release:
  stage: release
  when: on_success
  only:
    refs:
      - develop
    variables:
      - $CI_COMMIT_MESSAGE !~ /^chore.*/
  image: tarampampam/node:alpine
  script:
    - git config --global user.email $CI_EMAIL
    - git config --global user.name $CI_NAME
    - git config receive.advertisePushOptions true
    - git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA"
    - npm install
    - npm run release
    - git push http://${CI_USER}:${CI_ACCESS_TOKEN}@$CI_SERVER_HOST/$CI_PROJECT_PATH --follow-tags develop:develop

deploy:
  stage: deploy
  only:
    - master
  before_script:
    - npm i -g firebase-tools
    - npm i -g vuepress
  script:
    - npm install
    - vuepress build
    - firebase deploy --only hosting --token $FIREBASE_TOKEN_DEV

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

# Relevant references


: Roy Calderon
: