Fakultas Ilmu Komputer UI

.gitlab-ci.yml 1.84 KB
Newer Older
Zamil Majdy's avatar
Zamil Majdy committed
1
2
test:
  script:
3
  - uname -a
4
  - apt-get install -f
5
  - apt-get update -qy
6
7
8
9
10
11
  - apt-get install -y python-dev python-pip sudo postgresql postgresql-client libpq-dev libxss1 libappindicator1 libindicator7
  - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
  - sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
  - apt-get update
  - apt-get install -y google-chrome-stable
  - export CHROME_BIN=/usr/bin/google-chrome
12
  - curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
13
14
  - sudo apt-get install -y nodejs
  - npm install
Zamil Majdy's avatar
Zamil Majdy committed
15
16
17
18
19
20
  - 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
21
  - npm run karma
22
23
24
  artifacts:
    paths:
      - test/
Zamil Majdy's avatar
Zamil Majdy committed
25
26
27
28
29

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

production:
  type: deploy
  script:
  - apt-get update -qy
46
  - apt-get install sshpass
47
48
49
  - git clone https://gitlab.com/PPL2017csui/PPLA1.git
  - cd PPLA1
  - git checkout master
Zamil Majdy's avatar
Zamil Majdy committed
50
  - git pull
Zamil Majdy's avatar
Zamil Majdy committed
51
  - git remote add deployment ssh://kape@bot.recruit.id:8022/home/kape.git
Zamil Majdy's avatar
Zamil Majdy committed
52
  - mkdir ~/.ssh
53
  - echo -e "Host bot.recruit.id\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
54
  - sshpass -p yukcarikape git push deployment master:master --force
Zamil Majdy's avatar
Zamil Majdy committed
55
56
  only:
  - master