Fakultas Ilmu Komputer UI

.gitlab-ci.yml 1.43 KB
Newer Older
Zamil Majdy's avatar
Zamil Majdy committed
1
2
3
test:
  script:
  - apt-get update -qy
4
  - curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
Zamil Majdy's avatar
Zamil Majdy committed
5
  - apt-get install -y python-dev python-pip sudo postgresql postgresql-client libpq-dev
6
7
8
  - sudo apt-get install -y nodejs
  - sudo apt-get install -y npm
  - npm install
Zamil Majdy's avatar
Zamil Majdy committed
9
10
11
12
13
14
  - 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
15
  - karma start
Zamil Majdy's avatar
Zamil Majdy committed
16
17
18
19
20

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

production:
  type: deploy
  script:
  - apt-get update -qy
37
  - apt-get install sshpass
38
39
40
  - git clone https://gitlab.com/PPL2017csui/PPLA1.git
  - cd PPLA1
  - git checkout master
Zamil Majdy's avatar
Zamil Majdy committed
41
  - git pull
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
  - mkdir ~/.ssh
44
  - echo -e "Host bot.recruit.id\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
45
  - sshpass -p yukcarikape git push deployment master:master --force
Zamil Majdy's avatar
Zamil Majdy committed
46
47
  only:
  - master