Fakultas Ilmu Komputer UI

Commit cfa3ee72 authored by Ryan Karyadiputera's avatar Ryan Karyadiputera
Browse files

test3

parent 996d7ba7
Pipeline #76873 failed with stage
in 1 minute and 37 seconds
stages:
# - test
# - flake8
- flake8
- build
# - sonarqube
- deploy
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
DOCKER_DRIVER: overlay2
image: python:latest
......@@ -30,65 +25,6 @@ before_script:
- echo "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" >> sip/settings/.env
- echo "AWS_STORAGE_BUCKET_NAME=$AWS_STORAGE_BUCKET_NAME" >> sip/settings/.env
# dev-test:
# stage: test
# script:
# - python3 manage.py collectstatic --settings=sip.settings.staging --no-input
# - python3 manage.py makemigrations --settings=sip.settings.dev
# - python3 manage.py migrate --settings=sip.settings.dev
# - python3 manage.py test --settings=sip.settings.dev
# only:
# - development
# - /^.*PBI-.*$/
# staging-test:
# stage: test
# script:
# - python3 manage.py collectstatic --settings=sip.settings.staging --no-input
# - python3 manage.py makemigrations --settings=sip.settings.staging
# - python3 manage.py migrate --settings=sip.settings.staging
# - python3 manage.py test --settings=sip.settings.staging
# only:
# - staging
# lint:
# stage: flake8
# script:
# - flake8
# allow_failure: true
# except:
# - CI-CD
# sonarqube:
# image: nuga99/sonar-scanner-python
# stage: sonarqube
# cache:
# key: sonarqube
# paths:
# - .cache/pip
# before_script:
# - python3 -V
# - pip3 install -r requirements.txt
# - echo "DJANGO_SECRET_KEY=$DJANGO_SECRET_KEY" > sip/settings/.env
# - echo "AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" >> sip/settings/.env
# - echo "AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" >> sip/settings/.env
# - echo "AWS_STORAGE_BUCKET_NAME=$AWS_STORAGE_BUCKET_NAME" >> sip/settings/.env
# script:
# - if [[ $CI_COMMIT_REF_NAME == staging ]]; then ENVIRON="sip.settings.staging"; else ENVIRON="sip.settings.dev"; fi
# - coverage run --omit='manage.py,**/venv/*,**/python3*/**,core/**,laporan_praktikum/error_message/**,laporan_praktikum/custom_module/**,authentication/cas_wrapper.py,/usr/**' manage.py test --settings=${ENVIRON}
# - coverage report -m
# - coverage xml -i
# - sonar-scanner
# -Dsonar.host.url=https://pmpl.cs.ui.ac.id/sonarqube
# -Dsonar.projectKey=$SONARQUBE_PROJECT_KEY
# -Dsonar.login=$SONARQUBE_TOKEN
# -Dsonar.branch.name=$CI_COMMIT_REF_NAME
# only:
# - master
# - staging
# - development
# - /^.*PBI-.*$/
heroku-deploy:
image: ruby:2.4
stage: deploy
......
......@@ -14,6 +14,8 @@ import environ
import os
import dj_database_url
from datetime import timedelta
import mimetypes
mimetypes.add_type("text/css", ".css", True)
# Environ Setup
......@@ -30,7 +32,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = env('DJANGO_SECRET_KEY')
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
# HOST_URL = os.getenv('HOST_URL')
......
......@@ -13,6 +13,8 @@ https://docs.djangoproject.com/en/3.0/ref/settings/
import environ
import os
from datetime import timedelta
import mimetypes
mimetypes.add_type("text/css", ".css", True)
# Environ Setup
......
......@@ -15,7 +15,11 @@ import os
# import sys
import dj_database_url
from datetime import timedelta
import mimetypes
mimetypes.add_type("text/css", ".css", True)
#env = environ.Env()
#environ.Env.read_env() # Reading .env file
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
......@@ -24,10 +28,10 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY")
SECRET_KEY = os.getenv('DJANGO_SECRET_KEY', "s3cr3t_k3y_c4nn0t_h4ck3d_by_l33t_1337")
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
DEBUG = True
# HOST_URL = os.getenv('HOST_URL')
......@@ -120,7 +124,7 @@ if os.environ.get('DATABASE_URL') is not None:
# DOMAIN='https://ppl2020a1.cs.ui.ac.id'
# else:
# DOMAIN='http://si-praktikum-backend.herokuapp.com'
# DOMAIN='http://sipraktikum-backend.herokuapp.com'
# Password validation
......@@ -172,7 +176,7 @@ AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
AWS_LOCATION = 'static'
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static')
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATICFILES_DIRS = [
'static/',
os.path.join(BASE_DIR, "static"),
......@@ -231,7 +235,7 @@ JWT_AUTH = {
'JWT_AUTH_COOKIE': None,
}
SUCCESS_SSO_AUTH_REDIRECT = "http://sipraktikum-frontend-2020-a.herokuapp.com/"
SUCCESS_SSO_AUTH_REDIRECT = "http://ppl-berkah.herokuapp.com/"
CORS_ORIGIN_ALLOW_ALL = True
# CORS_ORIGIN_WHITELIST = [
......
......@@ -11,6 +11,6 @@ import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sip.settings.production')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sip.settings.staging')
application = get_wsgi_application()
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