Fakultas Ilmu Komputer UI

.gitlab-ci.yml 2.1 KB
Newer Older
Zamil Majdy's avatar
Zamil Majdy committed
1
2
test:
  script:
3
  - apt-get install -f
4
  - apt-get update -qy
5
6
7
8
9
10
  - apt-get install -y python-dev python-pip sudo postgresql postgresql-client libpq-dev libxss1 libappindicator1 libindicator7
  - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
  - sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
  - apt-get update
  - apt-get install -y google-chrome-stable
  - export CHROME_BIN=/usr/bin/google-chrome
11
  - curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
12
  - sudo apt-get install -y nodejs
13
14
  - sudo apt-get install -y build-essential
  - npm install -g node-gyp
15
  - npm install -g node-pre-gyp
16
  - npm install
M. Reza Qorib's avatar
M. Reza Qorib committed
17
  - npm run build-production
Zamil Majdy's avatar
Zamil Majdy committed
18
19
20
21
22
  - service postgresql start
  - sudo -u postgres psql -c "CREATE USER kape WITH PASSWORD 'kape' CREATEDB"
  - sudo -u postgres psql -c "CREATE DATABASE kape OWNER kape"
  - pip install -r requirements.txt
  - python manage.py migrate
M. Reza Qorib's avatar
M. Reza Qorib committed
23
  - python manage.py test
24
  - npm run karma
25
26
27
  artifacts:
    paths:
      - test/
Zamil Majdy's avatar
Zamil Majdy committed
28

29
30
31
32
33
34
35
36
37
38
39
pages:
  stage: deploy
  dependencies:
    - test
  script:
    - mv test/ public/
  artifacts:
    paths:
      - public
    expire_in: 30 days
      
Zamil Majdy's avatar
Zamil Majdy committed
40
41
42
43
staging:
  type: deploy
  script:
  - apt-get update -qy
44
  - apt-get install sshpass
45
46
  - git clone https://gitlab.com/PPL2017csui/PPLA1.git
  - cd PPLA1
Zamil Majdy's avatar
Zamil Majdy committed
47
  - git checkout develop
48
  - git pull
49
  - git remote add deployment ssh://kape@bot.recruit.id:8023/home/kape.git
Zamil Majdy's avatar
Zamil Majdy committed
50
51
  - mkdir ~/.ssh
  - echo -e "Host bot.recruit.id\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
Zamil Majdy's avatar
Zamil Majdy committed
52
  - sshpass -p yukcarikape git push deployment develop:master --force
53
  only:
Zamil Majdy's avatar
Zamil Majdy committed
54
   - develop
Zamil Majdy's avatar
Zamil Majdy committed
55
56
57
58
59

production:
  type: deploy
  script:
  - apt-get update -qy
60
  - apt-get install sshpass
61
62
63
  - git clone https://gitlab.com/PPL2017csui/PPLA1.git
  - cd PPLA1
  - git checkout master
Zamil Majdy's avatar
Zamil Majdy committed
64
  - git pull
Zamil Majdy's avatar
Zamil Majdy committed
65
  - git remote add deployment ssh://kape@bot.recruit.id:8022/home/kape.git
Zamil Majdy's avatar
Zamil Majdy committed
66
  - mkdir ~/.ssh
67
  - echo -e "Host bot.recruit.id\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
68
  - sshpass -p yukcarikape git push deployment master:master --force
Zamil Majdy's avatar
Zamil Majdy committed
69
70
  only:
  - master