.gitlab-ci.yml 921 Bytes
Newer Older
1 2 3
include:
  - local: 'prezbuilder-ci.yml'

4
default:
5 6 7 8 9
  retry: 2
  interruptible: true

stages:
  - test
10
  - build
11 12 13 14
  - deploy

lint:
  stage: test
15
  tags: [docker]
16
  image: node:12-buster
Guillaume Perréal's avatar
Guillaume Perréal committed
17 18
  variables:
    NPM_CONFIG_CACHE: "$CI_PROJECT_DIR/.npm"
19 20 21 22 23 24
  before_script:
    - node --version
    - npm --version
    - npm install
  script:
    - npm run lint
Guillaume Perréal's avatar
Guillaume Perréal committed
25
  cache:
26
    key: "$CI_COMMIT_REF_SLUG-$CI_JOB_NAME"
Guillaume Perréal's avatar
Guillaume Perréal committed
27 28
    paths:
      - "$NPM_CONFIG_CACHE"
29

30 31 32 33
docker:
  stage: build
  tags: [dind]
  variables:
Guillaume Perréal's avatar
Guillaume Perréal committed
34
    IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
35 36
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
37 38 39 40 41
  script:
    - docker build --tag "$IMAGE" .
    - docker run --rm "$IMAGE" build
    - docker push "$IMAGE"

42
pages:
43 44 45 46
  extends: .prezbuilder
  variables:
    PREZBUILDER_IMAGE: "$CI_REGISTRY_IMAGE"
    PREZBUILDER_TAG: "$CI_COMMIT_REF_SLUG"
Guillaume Perréal's avatar
Guillaume Perréal committed
47
  rules:
48
    - if: $CI_COMMIT_TAG