Fakultas Ilmu Komputer UI

.gitlab-ci.yml 1.4 KB
Newer Older
Zamil Majdy's avatar
Zamil Majdy committed
1
2
3
4
test:
  script:
  - apt-get update -qy
  - apt-get install -y python-dev python-pip sudo postgresql postgresql-client libpq-dev
5
  - curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
6
7
  - sudo apt-get install -y nodejs
  - npm install
Zamil Majdy's avatar
Zamil Majdy committed
8
9
10
11
12
13
  - 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
  - python manage.py test
14
  - karma start
Zamil Majdy's avatar
Zamil Majdy committed
15
16
17
18
19

staging:
  type: deploy
  script:
  - apt-get update -qy
20
  - apt-get install sshpass
21
22
  - git clone https://gitlab.com/PPL2017csui/PPLA1.git
  - cd PPLA1
Zamil Majdy's avatar
Zamil Majdy committed
23
  - git checkout develop
24
  - git pull
Zamil Majdy's avatar
Zamil Majdy committed
25
  - git remote add deployment ssh://kape@bot.recruit.id:8022/home/kape.git
Zamil Majdy's avatar
Zamil Majdy committed
26
27
  - mkdir ~/.ssh
  - echo -e "Host bot.recruit.id\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
Zamil Majdy's avatar
Zamil Majdy committed
28
  - sshpass -p yukcarikape git push deployment develop:master --force
29
  only:
Zamil Majdy's avatar
Zamil Majdy committed
30
   - develop
Zamil Majdy's avatar
Zamil Majdy committed
31
32
33
34
35

production:
  type: deploy
  script:
  - apt-get update -qy
36
  - apt-get install sshpass
37
38
39
  - git clone https://gitlab.com/PPL2017csui/PPLA1.git
  - cd PPLA1
  - git checkout master
Zamil Majdy's avatar
Zamil Majdy committed
40
  - git pull
Zamil Majdy's avatar
Zamil Majdy committed
41
  - git remote add deployment ssh://kape@bot.recruit.id:8022/home/kape.git
Zamil Majdy's avatar
Zamil Majdy committed
42
  - mkdir ~/.ssh
43
  - echo -e "Host bot.recruit.id\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
44
  - sshpass -p yukcarikape git push deployment master:master --force
Zamil Majdy's avatar
Zamil Majdy committed
45
46
  only:
  - master