From 2d2d2f05291cc0923b4c75d5b39420c195b9bc6d Mon Sep 17 00:00:00 2001
From: Muhammad Farhan Thariq <muhammad.farhan917@ui.ac.id>
Date: Sun, 27 Sep 2020 20:28:20 +0700
Subject: [PATCH] initial commit

---
 .gitlab-ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++
 Procfile       |  2 ++
 2 files changed, 42 insertions(+)
 create mode 100644 .gitlab-ci.yml
 create mode 100644 Procfile

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..cf480c5
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,40 @@
+
+stages:
+  - test
+  - deploy
+
+# Uncomment these lines if you would use tdd using selenium in your project
+# UnitTest:
+#   image: python:3.6
+#   stage: test
+#   before_script:
+#     - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
+#     - echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
+#     - pip install -r requirements.txt
+#     - python manage.py makemigrations
+#     - python manage.py migrate
+#     - apt-get update -qq && apt-get install -y -qq unzip
+#     - apt-get install -y google-chrome-stable
+#     - apt-get install -y xvfb
+#     - wget https://chromedriver.storage.googleapis.com/2.32/chromedriver_linux64.zip
+#     - unzip chromedriver_linux64.zip
+#     - python manage.py collectstatic --no-input
+#     - python manage.py runserver 8000 &
+#   when: on_success
+#   script:
+#     - coverage run manage.py test
+#     - coverage report -m
+
+Deployment:
+  image: ruby:2.4
+  stage: deploy
+  before_script:
+    - gem install dpl
+    - wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh
+  script:
+    - dpl --provider=heroku --app=$HEROKU_APPNAME --api-key=$HEROKU_APIKEY
+    - export HEROKU_API_KEY=$HEROKU_APIKEY
+    - heroku run --app $HEROKU_APPNAME python manage.py migrate
+  environment:
+    name: production
+    url: $HEROKU_APP_HOST
\ No newline at end of file
diff --git a/Procfile b/Procfile
new file mode 100644
index 0000000..2356e95
--- /dev/null
+++ b/Procfile
@@ -0,0 +1,2 @@
+migrate: bash python manage.py migrate
+web: gunicorn my_app.wsgi
\ No newline at end of file
-- 
GitLab