.gitlab-ci.yml 1.55 KB
Newer Older
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
1
stages:
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
2
3
  - test
  - create-vue-build
4
5
  - build-docker-server-container
  - build-docker-web-container
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
6

Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
test:
  stage: test
  image: node
  script: 
    - cd  website/studerende-dk
    - echo "Starting Linter"
    - npm install
    - npm run lint
    - echo "Linter Done!"


create-vue-build:
  only:
  - develop
  stage: create-vue-build
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  image: node
  script: 
    - cd  website/studerende-dk
    - echo "Start building App"
    - npm install
    - npm run build
    - echo "Build successfully!"
  artifacts:
    expire_in: 1 hour
    paths:
      - website/studerende-dk/dist
  cache:
    paths:
      - website/studerende-dk/node_modules/

37
build-docker-server-container:
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
38
39
  only:
  - develop
40
  stage: build-docker-server-container
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
41
42
43
44
45
46
  image: docker:latest
  services: 
    - name: docker:19.03.8-dind
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
47
    - cd backend
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
48
    - echo "Starting docker build of server."
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
49
50
    - docker build . -t "$CI_REGISTRY_IMAGE""/server"
    - docker push "$CI_REGISTRY_IMAGE""/server"
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
51
    - echo "Docker build of server done!"
52

53
build-docker-web-container:
54
55
  only:
  - develop
56
  stage: build-docker-web-container
57
58
59
60
61
62
  image: docker:latest
  services: 
    - name: docker:19.03.8-dind
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
63
    - cd website/studerende-dk
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
64
    - echo "Starting docker build of web."
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
65
66
    - docker build . -t "$CI_REGISTRY_IMAGE""/web"
    - docker push "$CI_REGISTRY_IMAGE""/web"
Johan Tanderup Degn's avatar
Johan Tanderup Degn committed
67
    - echo "Docker build of web done!"