.gitlab-ci.yml 828 Bytes
Newer Older
Emir's avatar
Emir committed
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
image: node:latest

stages:
  - build
  - test
  - deploy

install:
  stage: build
  script:
    - npm install
  # Keep node_modules-folder for the following stages:
  artifacts:
    paths:
      - node_modules

test:
  stage: test
  script:
    - npm test

flow:
  stage: test
  script:
    - npm install --global flow-bin
    - flow check

deploy:
  stage: deploy
  script:
    - mkdir ~/.ssh
Emir's avatar
Emir committed
32
    - echo "$known_hosts" > ~/.ssh/known_hosts
Emir's avatar
Emir committed
33
34
35
    - touch ~/.ssh/id_rsa
    - chmod 600 ~/.ssh/id_rsa # Required permission by ssh
    - echo "$key" > ~/.ssh/id_rsa
Emir's avatar
Emir committed
36
37
38
39
40
    - echo "$key" | cut -d'_' -f 10
    - apt update
    - apt install --assume-yes rsync
    - rsync --archive --delete --exclude='.git' --exclude='node_modules' . speed@35.228.31.13:app
    - ssh speed@35.228.31.13 systemctl --user restart app
Emir's avatar
Emir committed
41
42
  only:
    - master