En raison du déménagement des baies serveurs, les services gitlab.irstea.fr et mattermost.irstea.fr seront interrompus le samedi 2 octobre 2021 au matin. Ils devraient revenir à la normale dans la journée.

.gitlab-ci.yml 924 Bytes
Newer Older
1
default:
2
3
4
5
6
  retry: 2
  interruptible: true

stages:
  - test
7
  - build
8
9
10
11
  - deploy

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

27
28
29
30
31
32
33
34
35
36
docker:
  stage: build
  tags: [dind]
  variables:
    - IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
  script:
    - docker build --tag "$IMAGE" .
    - docker run --rm "$IMAGE" build
    - docker push "$IMAGE"

37
38
pages:
  stage: deploy
39
  tags: [dind]
Guillaume Perréal's avatar
Guillaume Perréal committed
40
41
  rules:
    - if: $CI_COMMIT_BRANCH == "master"
42
43
  variables:
    - IMAGE: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
44
  script:
45
    - docker run --rm -v "$PWD/src:/src/ro" -v "$PWD/public:/public" "$IMAGE" build
46
  artifacts:
Guillaume Perréal's avatar
Guillaume Perréal committed
47
48
    name: pages
    paths:
49
      - public/