Skip to content

Commit edfd51f

Browse files
authored
Merge pull request #12 from Djacket/travis-init
Configuration for continuous integration in `Travis` build system added, regarding issue #10.
2 parents fa4dd6f + 7a27c8a commit edfd51f

4 files changed

Lines changed: 27 additions & 5 deletions

File tree

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sudo: false
2+
os:
3+
- linux
4+
language: python
5+
python:
6+
- "3.6"
7+
env:
8+
- DJKR_MODE=ci DALWD_HSTS="['0.0.0.0','localhost']" DSCT_KY='secrettravissequence'
9+
install: "pip install -r requirements.txt"
10+
before_script:
11+
- python core/backend/manage.py migrate
12+
script: python core/backend/manage.py test

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,8 @@
1919
- `404` errors for icons fixed.
2020
- JS scripts modified for new versions of `jQuery` and `Chart.js`.
2121
- `TypeError: get_available_name() got an unexpected keyword argument 'max_length'` issue fixed.
22+
23+
24+
# 0.2.2 (April 22, 2018)
25+
* TravisCI configuration added.
26+
- Configuration for continuous integration in `Travis` build system added, regarding issue #10.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Djacket
2+
[![Build Status](https://travis-ci.org/Djacket/djacket.svg?branch=master)](https://travis-ci.org/Djacket/djacket)
3+
[![Open Source Love](https://badges.frapsoft.com/os/mit/mit.svg?v=102)](https://github.com/ellerbrock/open-source-badge/)
4+
<br><br>
25
A Git server written in [Python/Django](https://www.djangoproject.com/). It's meant to be for personal
36
or small business usages. Installation is available and tested for Linux servers.
47

core/backend/djacket/settings.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def osenv(env_name):
2424
return os.environ.get(env_name, '')
2525

2626

27+
IS_CI = osenv('DJKR_MODE') == 'ci'
28+
2729
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
2830

2931

@@ -95,7 +97,7 @@ def osenv(env_name):
9597
DATABASES = {
9698
'default': {
9799
'ENGINE': 'django.db.backends.sqlite3',
98-
'NAME': '/srv/db/djacketdb.sqlite3'
100+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3') if IS_CI else '/srv/db/djacketdb.sqlite3'
99101
}
100102
}
101103

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

120122
STATIC_URL = '/static/'
121-
STATIC_ROOT = '/srv/static/'
123+
STATIC_ROOT = os.path.join(BASE_DIR, '/static/') if IS_CI else '/srv/static/'
122124
STATICFILES_DIRS = [os.path.join(FRONTEND_DIR, 'public', 'build', 'static'),]
123125

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

133-
MEDIA_ROOT = '/srv/media/'
135+
MEDIA_ROOT = os.path.join(BASE_DIR, '/media/') if IS_CI else '/srv/media/'
134136
MEDIA_URL = '/media/'
135137

136138

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

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

156-
DEBUG = False if osenv('DJKR_MODE') in ['prod', ''] else True
158+
DEBUG = True if osenv('DJKR_MODE') in ['dev', 'ci'] else False
157159

158160

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

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

0 commit comments

Comments
 (0)