Fakultas Ilmu Komputer UI

.gitlab-ci.yml 1.17 KB
Newer Older
Zamil Majdy's avatar
Zamil Majdy committed
1
2
test:
  script:
Zamil Majdy's avatar
Zamil Majdy committed
3
  - apt-get update -qy
4
5
  - apt-get install -y python-dev python-pip sudo postgresql postgresql-client libpq-dev
  - service postgresql start
6
7
  - sudo -u postgres psql -c "CREATE USER kape WITH PASSWORD 'kape' CREATEDB"
  - sudo -u postgres psql -c "CREATE DATABASE kape OWNER kape"
Zamil Majdy's avatar
Zamil Majdy committed
8
  - pip install -r requirements.txt
9
  - python manage.py migrate
Zamil Majdy's avatar
Zamil Majdy committed
10
11
12
13
14
15
  - python manage.py test

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

production:
  type: deploy
  script:
  - apt-get update -qy
Zamil Majdy's avatar
Zamil Majdy committed
32
  - sudo 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 remote add deployment ssh://kape@bot.recruit.id:8022/home/kape.git
37
  - sshpass -p yukcarikape git push deployment master:master --force
Zamil Majdy's avatar
Zamil Majdy committed
38
39
  only:
  - master