Skip to content
This repository has been archived by the owner on Jan 11, 2019. It is now read-only.

Commit

Permalink
update boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
FinalAngel committed Jan 18, 2016
1 parent b46d368 commit 2a8e57b
Show file tree
Hide file tree
Showing 23 changed files with 1,552 additions and 94 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@ data/
env/
node_modules/
tests/coverage/
tools/server/env/
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -42,7 +42,7 @@ Manual
#. Choose a starting installation from above.
#. Once you have created a project, copy all ``static/`` files from inside the
django-cms-explorer project into your projects ``mysite/static/`` folder.
#. Next do the same with ``private/`` and ``templates/``. All pre-existing
#. Next do the same with ``private/``, ``tools/`` and ``templates/``. All pre-existing
files can be removed and replaced. More about the file structure is documented
in our `boilerplate guidelines <https://aldryn-boilerplate-bootstrap3.readthedocs.org/en/latest/structure/index.html>`_.
#. Restart your server and open your site using ``http://localhost:8000/en/``.
Expand Down
143 changes: 72 additions & 71 deletions gulpfile.js 100755 → 100644
@@ -1,96 +1,97 @@
/*!
* @author: Divio AG
* @copyright: http://www.divio.ch
/*
* Copyright (c) 2013, Divio AG
* Licensed under BSD
* http://github.com/aldryn/aldryn-boilerplate-bootstrap3
*/

'use strict';

// #############################################################################
// #IMPORTS#
var autoprefixer = require('gulp-autoprefixer');
// IMPORTS
var argv = require('minimist')(process.argv.slice(2));
var gulp = require('gulp');
var gutil = require('gulp-util');
var karma = require('karma').server;
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var minifyCss = require('gulp-minify-css');
var protractor = require('gulp-protractor').protractor;
var webdriverUpdate = require('gulp-protractor').webdriver_update;

// #############################################################################
// #SETTINGS#
// SETTINGS
var PROJECT_ROOT = __dirname;
var PROJECT_PATH = {
'sass': PROJECT_ROOT + '/private/sass',
'css': PROJECT_ROOT + '/static/css',
'tests': PROJECT_ROOT + '/tests'
bower: PROJECT_ROOT + '/static/vendor',
css: PROJECT_ROOT + '/static/css',
docs: PROJECT_ROOT + '/static/docs',
fonts: PROJECT_ROOT + '/static/fonts',
html: PROJECT_ROOT + '/templates',
images: PROJECT_ROOT + '/static/img',
icons: PROJECT_ROOT + '/private/icons',
js: PROJECT_ROOT + '/static/js',
sass: PROJECT_ROOT + '/private/sass',
tests: PROJECT_ROOT + '/tests'
};

var PROJECT_PATTERNS = {
'sass': [
images: [
PROJECT_PATH.images + '/**/*',
// exclude from preprocessing
'!' + PROJECT_PATH.images + '/dummy/*/**'
],
js: [
'gulpfile.js',
PROJECT_PATH.js + '/**/*.js',
PROJECT_PATH.tests + '/**/*.js',
// exclude from linting
'!' + PROJECT_PATH.js + '/*.min.js',
'!' + PROJECT_PATH.js + '/**/*.min.js',
'!' + PROJECT_PATH.tests + '/coverage/**/*'
],
sass: [
PROJECT_PATH.sass + '/**/*.{scss,sass}'
]
};

// #############################################################################
// #TASKS#
gulp.task('sass', function () {
gulp.src(PROJECT_PATTERNS.sass)
.pipe(sourcemaps.init())
.pipe(sass())
.on('error', function (error) {
gutil.log(gutil.colors.red(
'Error (' + error.plugin + '): ' + error.messageFormatted)
);
})
.pipe(autoprefixer({
// browsers are coming from browserslist file
cascade: false
}))
.pipe(minifyCss({
// fixes font imports from google fonts
rebase: false
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest(PROJECT_PATH.css));
});
var PORT = parseInt(process.env.PORT, 10) || 8000;
var DEBUG = argv.debug;

// #######################################
// #TESTS#
gulp.task('tests', ['tests:unit', 'tests:integration']);
gulp.task('tests:unit', function (done) {
// run javascript tests
karma.start({
configFile: PROJECT_PATH.tests + '/karma.conf.js',
singleRun: true
}, done);
});
function task(id) {
return require('./tools/tasks/' + id)(gulp, {
PROJECT_ROOT: PROJECT_ROOT,
PROJECT_PATH: PROJECT_PATH,
PROJECT_PATTERNS: PROJECT_PATTERNS,
DEBUG: DEBUG,
PORT: PORT
});
}

gulp.task('tests:webdriver', webdriverUpdate);
gulp.task('tests:integration', ['tests:webdriver'], function () {
return gulp.src([PROJECT_PATH.tests + '/integration/specs/*.js'])
.pipe(protractor({
configFile: PROJECT_PATH.tests + '/protractor.conf.js',
args: []
}))
.on('error', function (error) {
gutil.log(gutil.colors.red(
'Error (' + error.plugin + '): ' + error.message)
);
});
});
gulp.task('bower', task('bower'));
gulp.task('lint:javascript', task('lint/javascript'));
gulp.task('lint', ['lint:javascript']);
gulp.task('sass', task('sass'));
gulp.task('build', ['sass']);

gulp.task('tests:watch', function () {
// run javascript tests
karma.start({
configFile: PROJECT_PATH.tests + '/karma.conf.js'
});
});
/**
* GULP_MODE === 'production' means we have a limited
* subset of tasks, namely sass, bower and lint to
* speed up the deployment / installation process.
*/
if (process.env.GULP_MODE !== 'production') {
gulp.task('images', task('images'));
gulp.task('docs', task('docs'));
gulp.task('preprocess', ['sass', 'images', 'docs']);
gulp.task('icons', task('icons'));

gulp.task('browser', task('browser'));

gulp.task('tests:lint', ['lint:javascript']);
gulp.task('tests:unit', task('tests/unit'));
gulp.task('tests:watch', ['tests:lint'], task('tests/watch'));
gulp.task('tests', ['tests:unit', 'tests:integration', 'tests:lint']);

var webdriverUpdate = require('gulp-protractor').webdriver_update;
gulp.task('tests:webdriver', webdriverUpdate);
gulp.task('tests:integration', ['tests:webdriver'], task('tests/integration'));
}

// #############################################################################
// #COMMANDS#
gulp.task('watch', function () {
gulp.watch(PROJECT_PATTERNS.sass, ['sass']);
gulp.watch(PROJECT_PATTERNS.js, ['lint']);
});

gulp.task('default', ['sass', 'watch']);
gulp.task('default', ['bower', 'sass', 'lint', 'watch']);
56 changes: 34 additions & 22 deletions package.json
@@ -1,29 +1,41 @@
{
"name": "package",
"private": true,
"engines": {
"node": "0.9.0"
"dependencies": {
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.0.1",
"gulp-bower": "^0.0.10",
"gulp-if": "^1.2.5",
"gulp-util": "^3.0.6",
"gulp-minify-css": "^1.2.0",
"gulp-sass": "^2.0.4",
"gulp-jscs": "^2.0.0",
"gulp-jshint": "^1.11.2",
"jshint-stylish": "^2.0.1",
"gulp-sourcemaps": "^1.5.2",
"minimist": "^1.1.3"
},
"devDependencies": {
"browserslist-saucelabs": "0.1.2",
"gulp": "3.9.0",
"gulp-autoprefixer": "2.3.1",
"gulp-minify-css": "1.2.0",
"gulp-protractor": "1.0.0",
"gulp-sass": "2.0.3",
"gulp-sourcemaps": "1.5.2",
"gulp-util": "3.0.6",
"jasmine-core": "2.3.4",
"karma": "0.12.37",
"karma-coverage": "0.4.2",
"karma-coveralls": "1.1.0",
"karma-fixture": "0.2.5",
"karma-html2js-preprocessor": "0.1.0",
"karma-jasmine": "0.3.6",
"karma-json-fixtures-preprocessor": "0.0.4",
"karma-phantomjs-launcher": "0.2.0",
"karma-sauce-launcher": "0.2.14",
"phantomjs": "1.9.17",
"protractor": "2.1.0"
"browser-sync": "^2.8.2",
"browserslist-saucelabs": "^0.1.4",
"gulp-cached": "^1.1.0",
"gulp-iconfont": "<5.0.0",
"gulp-iconfont-css": "^1.0.1",
"gulp-imagemin": "^2.3.0",
"gulp-protractor": "^1.0.0",
"gulp-scss-lint": "^0.3.0",
"gulp-yuidoc": "^0.1.2",
"jasmine-core": "^2.3.4",
"karma": "^0.13.8",
"karma-coverage": "^0.5.0",
"karma-coveralls": "^1.1.2",
"karma-fixture": "^0.2.5",
"karma-html2js-preprocessor": "^0.1.0",
"karma-jasmine": "^0.3.6",
"karma-json-fixtures-preprocessor": "^0.0.5",
"karma-phantomjs-launcher": "^0.2.1",
"karma-sauce-launcher": "^0.2.14",
"phantomjs": "^1.9.17",
"protractor": "^2.1.0"
}
}
18 changes: 18 additions & 0 deletions tools/server/Makefile
@@ -0,0 +1,18 @@
SHELL := /bin/bash

PORT = 8000
ENV = env
VENV = source $(ENV)/bin/activate
PIP = $(VENV); $(ENV)/bin/pip
MANAGE = $(VENV); $(ENV)/bin/python

all:
make run

install:
virtualenv $(ENV)
$(PIP) install -r requirements.txt
$(MANAGE) manage.py migrate

run:
$(MANAGE) manage.py runserver 0.0.0.0:$(PORT)
Binary file added tools/server/db.sqlite3
Binary file not shown.
10 changes: 10 additions & 0 deletions tools/server/manage.py
@@ -0,0 +1,10 @@
#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "src.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)
3 changes: 3 additions & 0 deletions tools/server/requirements.txt
@@ -0,0 +1,3 @@
Django>=1.8.0
django-cms>=3.1.0
djangocms-text-ckeditor>=2.5.2
Empty file added tools/server/src/__init__.py
Empty file.

0 comments on commit 2a8e57b

Please sign in to comment.