Fakultas Ilmu Komputer UI

.gitlab-ci.yml 1.24 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
  - python manage.py test
11
  - sudo apt-get install sshpass
12
13
  - git fetch
  - git remote add deployment ssh://kape@bot.recruit.id:8022/home/kape.git
14
15
16
17
  - git config --global user.email "gitlab@autodeploy.com"
  - git config --global user.name "Gitlab Autodeploy"
  - git add -A
  - git commit -m "GitLab Auto Deployment"
18
  - sshpass -p yukcarikape git push deployment UserStory1:master
Zamil Majdy's avatar
Zamil Majdy committed
19
20
21
22
23

staging:
  type: deploy
  script:
  - apt-get update -qy
Zamil Majdy's avatar
Zamil Majdy committed
24
  - sudo apt-get install sshpass
25
  - git fetch
Zamil Majdy's avatar
Zamil Majdy committed
26
27
  - git remote add deployment ssh://kape@bot.recruit.id:8022/home/kape.git
  - sshpass -p yukcarikape git push deployment develop:master
Zamil Majdy's avatar
Zamil Majdy committed
28
29
30
31
32
33
34
  only:
  - develop

production:
  type: deploy
  script:
  - apt-get update -qy
Zamil Majdy's avatar
Zamil Majdy committed
35
  - sudo apt-get install sshpass
36
  - git fetch
Zamil Majdy's avatar
Zamil Majdy committed
37
38
  - git remote add deployment ssh://kape@bot.recruit.id:8022/home/kape.git
  - sshpass -p yukcarikape git push deployment master:master
Zamil Majdy's avatar
Zamil Majdy committed
39
40
  only:
  - master