Fakultas Ilmu Komputer UI

.gitlab-ci.yml 1.69 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
Zamil Majdy's avatar
Zamil Majdy committed
12
13
  - git status
  - git checkout -b ci_processing
14
  - git remote add deployment ssh://kape@bot.recruit.id:8022/home/kape.git
15
16
17
18
  - git config --global user.email "gitlab@autodeploy.com"
  - git config --global user.name "Gitlab Autodeploy"
  - git add -A
  - git commit -m "GitLab Auto Deployment"
Zamil Majdy's avatar
Zamil Majdy committed
19
  - sshpass -p yukcarikape git push deployment ci_processing:master --force
Zamil Majdy's avatar
Zamil Majdy committed
20
21
22
23
24

staging:
  type: deploy
  script:
  - apt-get update -qy
Zamil Majdy's avatar
Zamil Majdy committed
25
  - sudo apt-get install sshpass
Zamil Majdy's avatar
Zamil Majdy committed
26
  - git checkout -b ci_processing
Zamil Majdy's avatar
Zamil Majdy committed
27
  - git remote add deployment ssh://kape@bot.recruit.id:8022/home/kape.git
Zamil Majdy's avatar
Zamil Majdy committed
28
29
30
31
32
  - git config --global user.email "gitlab@autodeploy.com"
  - git config --global user.name "Gitlab Autodeploy"
  - git add -A
  - git commit -m "GitLab Auto Deployment"
  - sshpass -p yukcarikape git push deployment ci_processing:master --force
Zamil Majdy's avatar
Zamil Majdy committed
33
34
35
36
37
38
39
  only:
  - develop

production:
  type: deploy
  script:
  - apt-get update -qy
Zamil Majdy's avatar
Zamil Majdy committed
40
  - sudo apt-get install sshpass
Zamil Majdy's avatar
Zamil Majdy committed
41
  - git checkout -b ci_processing
Zamil Majdy's avatar
Zamil Majdy committed
42
  - git remote add deployment ssh://kape@bot.recruit.id:8022/home/kape.git
Zamil Majdy's avatar
Zamil Majdy committed
43
44
45
46
47
  - git config --global user.email "gitlab@autodeploy.com"
  - git config --global user.name "Gitlab Autodeploy"
  - git add -A
  - git commit -m "GitLab Auto Deployment"
  - sshpass -p yukcarikape git push deployment ci_processing:master --force
Zamil Majdy's avatar
Zamil Majdy committed
48
49
  only:
  - master