Fakultas Ilmu Komputer UI

.gitlab-ci.yml 1.56 KB
Newer Older
Zamil Majdy's avatar
Zamil Majdy committed
1
2
3
test:
  script:
  - apt-get update -qy
4
5
6
  - apt-get install -y python-dev python-pip sudo postgresql postgresql-client libpq-dev libxss1 libappindicator1 libindicator7
  - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
  - sudo dpkg -i google-chrome*.deb
7
  - curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
8
9
  - sudo apt-get install -y nodejs
  - npm install
Zamil Majdy's avatar
Zamil Majdy committed
10
11
12
13
14
15
  - 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
16
  - npm run karma
Zamil Majdy's avatar
Zamil Majdy committed
17
18
19
20
21

staging:
  type: deploy
  script:
  - apt-get update -qy
22
  - apt-get install sshpass
23
24
  - git clone https://gitlab.com/PPL2017csui/PPLA1.git
  - cd PPLA1
Zamil Majdy's avatar
Zamil Majdy committed
25
  - git checkout develop
26
  - git pull
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
  - mkdir ~/.ssh
  - echo -e "Host bot.recruit.id\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
Zamil Majdy's avatar
Zamil Majdy committed
30
  - sshpass -p yukcarikape git push deployment develop:master --force
31
  only:
Zamil Majdy's avatar
Zamil Majdy committed
32
   - develop
Zamil Majdy's avatar
Zamil Majdy committed
33
34
35
36
37

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