.gitlab-ci.yml 1.22 KB
Newer Older
1
stages:
2
  - test
3
  - build
Zac Wood's avatar
Zac Wood committed
4
 
5
test_api:
Zac Wood's avatar
Zac Wood committed
6
  image: ruby:2.5
7
  stage: test
8
  script:
Zac Wood's avatar
Zac Wood committed
9
10
11
12
    - cd schedules_api
    - bundle install
    - rails db:migrate
    - rails test
13

14
15
16
17
18
19
test_web:
  image: node:9
  stage: test
  script:
    - cd schedules_web
    - yarn
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
    - yarn build

build_web:
  stage: build
  retry: 2
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  script:
    - mkdir -p /root/.docker
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /root/.docker/config.json
    - /kaniko/executor --context $CI_PROJECT_DIR/schedules_web --dockerfile $CI_PROJECT_DIR/schedules_web/Dockerfile --destination $CI_REGISTRY_IMAGE/web:$CI_COMMIT_TAG
  only:
    - tags

build_api:
  stage: build
  retry: 2
  image:
    name: gcr.io/kaniko-project/executor:debug
    entrypoint: [""]
  script:
    - mkdir -p /root/.docker
    - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /root/.docker/config.json
    - /kaniko/executor --context $CI_PROJECT_DIR/schedules_api --dockerfile $CI_PROJECT_DIR/schedules_api/Dockerfile --destination $CI_REGISTRY_IMAGE/api:$CI_COMMIT_TAG
  only:
    - tags