Fakultas Ilmu Komputer UI

Commit 017ccc45 authored by Annisa Devi Nurmalasari's avatar Annisa Devi Nurmalasari
Browse files

Initial Commit

parent 731dcd62
Pipeline #95502 failed with stages
in 12 minutes and 6 seconds
image: python:3.8
stages:
- test
- code-cleanliness
- deploy
before_script:
# to export variable to target environment
- export SECRET_KEY=$SECRET_KEY
- EMAIL_HOST_PASSWORD=$EMAIL_HOST_PASSWORD
- EMAIL_HOST_USER=$EMAIL_HOST_USER
- PASSWORD_ADMIN_TEST="Test123!"
- PASSWORD_UNIT_TEST="Test123!"
# to check if OK
- env
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
# Feel free to remove this in your generated project.
.disable_on_template: &disable_on_template
rules:
- if: '$CI_COMMIT_REF_NAME != "template"'
.django_before_script: &django_before_script |-
pip install -r requirements.txt
python manage.py collectstatic --no-input
.coverage_artifacts: &coverage_artifacts
artifacts:
paths:
- .coverage*
UnitTest:
<<: *disable_on_template
<<: *coverage_artifacts
stage: test
before_script:
- *django_before_script
script:
- coverage run --parallel --include="./*" --omit="manage.py,project_name/*"
manage.py test --exclude-tag=functional
FunctionalTest:
<<: *disable_on_template
<<: *coverage_artifacts
stage: test
before_script:
- apt-get update -q && apt-get install -yq chromium-driver
- *django_before_script
lint:
image: python:3.7.3
stage: code-cleanliness
script:
- coverage run --parallel --include="./*" --omit="manage.py,project_name/*"
manage.py test --tag=functional
- pip install -r requirements.txt
- pylint walkiddie_backend hello_world accounts profiles admin toko investasi mainan sales_detail ringkasan_sales laporan_operator
allow_failure: true
Coverage:
<<: *disable_on_template
stage: deploy
Test:
image: python:3.7.3
stage: code-cleanliness
before_script:
- pip install coverage
- coverage combine
- 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
- apt-get install -y chromium
- python manage.py collectstatic --no-input
- python manage.py runserver 8000 &
when: on_success
script:
- coverage run --include="hello_world/*","accounts/*","profiles/*","admin/*","toko/*","investasi/*","mainan/*","sales_detail/*","ringkasan_sales/*","laporan_operator/*" --omit='manage.py' manage.py test
- coverage xml -i
- coverage report -m
- coverage html
artifacts:
paths:
- htmlcov/
- coverage.xml
Deployment:
rules:
......@@ -83,4 +47,5 @@ Deployment:
- heroku run --app $HEROKU_APP_NAME migrate
environment:
name: production
url: https://$HEROKU_APP_NAME.herokuapp.com
\ No newline at end of file
url: https://$HEROKU_APP_NAME.herokuapp.com
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment