Fakultas Ilmu Komputer UI

.gitlab-ci.yml 893 Bytes
Newer Older
Zamil Majdy's avatar
Zamil Majdy committed
1
2
3
test:
  script:
  - export DATABASE_URL=postgres://kape:kape@104.236.76.161:5432/kape
Zamil Majdy's avatar
Zamil Majdy committed
4
  - apt-get update -qy
5
6
  - apt-get install -y python-dev python-pip sudo postgresql postgresql-client libpq-dev
  - service postgresql start
7
  - sudo -u postgres psql
8
9
10
  - CREATE USER kape WITH PASSWORD 'kape' CREATEDB;
  - CREATE DATABASE kape OWNER kape;
  - \q
Zamil Majdy's avatar
Zamil Majdy committed
11
  - pip install -r requirements.txt
12
  - python manage.py migrate
Zamil Majdy's avatar
Zamil Majdy committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  - python manage.py test

staging:
  type: deploy
  script:
  - apt-get update -qy
  - apt-get install -y ruby-dev
  - gem install dpl
  - dpl --provider=heroku --app=gitlab-ci-python-test-staging --api-key=$HEROKU_STAGING_API_KEY
  only:
  - develop

production:
  type: deploy
  script:
  - apt-get update -qy
  - apt-get install -y ruby-dev
  - gem install dpl
  - dpl --provider=heroku --app=gitlab-ci-python-test-prod --api-key=$HEROKU_PRODUCTION_API_KEY
  only:
  - master