Skip to content

Commit

Permalink
Merge pull request #12 from Djacket/travis-init
Browse files Browse the repository at this point in the history
Configuration for continuous integration in `Travis` build system added, regarding issue #10.
  • Loading branch information
moeenz authored Apr 22, 2018
2 parents fa4dd6f + 7a27c8a commit edfd51f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sudo: false
os:
- linux
language: python
python:
- "3.6"
env:
- DJKR_MODE=ci DALWD_HSTS="['0.0.0.0','localhost']" DSCT_KY='secrettravissequence'
install: "pip install -r requirements.txt"
before_script:
- python core/backend/manage.py migrate
script: python core/backend/manage.py test
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@
- `404` errors for icons fixed.
- JS scripts modified for new versions of `jQuery` and `Chart.js`.
- `TypeError: get_available_name() got an unexpected keyword argument 'max_length'` issue fixed.


# 0.2.2 (April 22, 2018)
* TravisCI configuration added.
- Configuration for continuous integration in `Travis` build system added, regarding issue #10.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Djacket
[![Build Status](https://travis-ci.org/Djacket/djacket.svg?branch=master)](https://travis-ci.org/Djacket/djacket)
[![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/ellerbrock/open-source-badge/)
<br><br>
A Git server written in [Python/Django](https://www.djangoproject.com/). It's meant to be for personal
or small business usages. Installation is available and tested for Linux servers.

Expand Down
12 changes: 7 additions & 5 deletions core/backend/djacket/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def osenv(env_name):
return os.environ.get(env_name, '')


IS_CI = osenv('DJKR_MODE') == 'ci'

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


Expand Down Expand Up @@ -95,7 +97,7 @@ def osenv(env_name):
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': '/srv/db/djacketdb.sqlite3'
'NAME': os.path.join(BASE_DIR, 'db.sqlite3') if IS_CI else '/srv/db/djacketdb.sqlite3'
}
}

Expand All @@ -118,7 +120,7 @@ def osenv(env_name):
# Static files will be collected to be served in 'BASE_DIR/../static/', outside of server code.

STATIC_URL = '/static/'
STATIC_ROOT = '/srv/static/'
STATIC_ROOT = os.path.join(BASE_DIR, '/static/') if IS_CI else '/srv/static/'
STATICFILES_DIRS = [os.path.join(FRONTEND_DIR, 'public', 'build', 'static'),]

STATICFILES_FINDERS = (
Expand All @@ -130,7 +132,7 @@ def osenv(env_name):
# Media files (User avatar images)
# Default is set to ''BASE_DIR/../media', outside of server code.

MEDIA_ROOT = '/srv/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, '/media/') if IS_CI else '/srv/media/'
MEDIA_URL = '/media/'


Expand All @@ -153,7 +155,7 @@ def osenv(env_name):

# SECURITY WARNING: don't run with debug turned on in production!

DEBUG = False if osenv('DJKR_MODE') in ['prod', ''] else True
DEBUG = True if osenv('DJKR_MODE') in ['dev', 'ci'] else False


# For security reasons, set domain or host of your site in ALLOWED_HOSTS
Expand All @@ -167,4 +169,4 @@ def osenv(env_name):
# Git repositories deposit folder on server.
# This is where all the repos will be stored and maintained.

GIT_DEPOSIT_ROOT = '/srv/deposit/'
GIT_DEPOSIT_ROOT = os.path.join(BASE_DIR, '/deposit/') if IS_CI else '/srv/deposit/'

0 comments on commit edfd51f

Please sign in to comment.