Fakultas Ilmu Komputer UI

.gitlab-ci.yml 1.27 KB
Newer Older
Zamil Majdy's avatar
Zamil Majdy committed
1
2
3
4
5
6
7
8
9
10
test:
  script:
  - apt-get update -qy
  - apt-get install -y python-dev python-pip sudo postgresql postgresql-client libpq-dev
  - 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
Zamil Majdy's avatar
Zamil Majdy committed
11
12
13
14
15

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

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