Skip to content
Snippets Groups Projects
Commit af36f4c4 authored by PavelBegunkov's avatar PavelBegunkov
Browse files

Deployment changes

-- remove gulp global install (need sudo)
-- add drop\create database
-- fix folder creation problem
parent 9745cb95
Branches
Tags
No related merge requests found
......@@ -11,7 +11,7 @@ deploy: DB_deploy Tasker_deploy Tasker_run
Tasker_install: Tasker_deploy
npm install -g gulp
@
Tasker_deploy:
npm install
......
......@@ -3,13 +3,16 @@ $(subst .sql, , $(wildcard $1/*.sql))
endef
USER := $(shell bash -c 'read -p "Username: " pwd; echo $$username')
USER := $(shell bash -c 'read -p "Username: " username; echo $$username')
PASS := $(shell bash -c 'read -s -p "Password: " pwd; echo $$pwd')
DB := mmcs_rating
default: deploy
@
install: $(call GET_NAMES, structure) \
install: \
clear \
$(call GET_NAMES, structure) \
$(call GET_NAMES, data) \
$(call GET_NAMES, constraints) \
deploy
......@@ -18,6 +21,10 @@ deploy
deploy: $(call GET_NAMES, stored)
@
clear:
yes | mysqladmin -u $(USER) $(PASS) drop $(DB) || true
mysqladmin -u $(USER) $(PASS) create $(DB);
%:
mysql -u $(USER) $(PASS) $(DB) < $@.sql
......
......@@ -144,7 +144,7 @@ var constructTask = function (config) {
lazypipe().pipe(changed, config.dst, ext) :
empty;
gulp.src(config.src)
return gulp.src(config.src)
.pipe(chgPipe())
.pipe(midPipe())
.on('error', errorHandler)
......@@ -165,19 +165,19 @@ var constructWatch = function (config) {
gulp.task('less:compile', function () {
constructTask(getConfig('less'));
return constructTask(getConfig('less'));
});
gulp.task('css:copy', function () {
constructTask(getConfig('css'));
return constructTask(getConfig('css'));
});
gulp.task('js:copy', function () {
constructTask(getConfig('js'));
return constructTask(getConfig('js'));
});
gulp.task('config:copy', function () {
constructTask({
return constructTask({
src: paths.src.config,
dst: paths.dst.config
});
......@@ -185,7 +185,7 @@ gulp.task('config:copy', function () {
gulp.task('components:copy', function () {
constructTask(getConfig('css_components'));
constructTask(getConfig('js_components'));
return constructTask(getConfig('js_components'));
});
......@@ -196,11 +196,18 @@ gulp.task('folders:create', function () {
var dirs = [
app + '/logs/',
app + '/static/',
app + '/static/components/'
];
dirs.forEach(function (i) {
fs.mkdir(dirs[i]);
dirs.forEach(function (dir) {
try {
fs.mkdirSync(dir);
} catch (err) {
if (err.code !== 'EEXIST') {
throw err;
}
}
});
});
......
{
"name": "gulp",
"version": "1.0.0",
"description": "",
"main": "gulpfile.js",
"dependencies": {
"name": "GradeRatingSystem",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"gulp": "^3.9.0",
"gulp-changed": "^1.2.1",
"gulp-autoprefixer": "^2.3.1",
......@@ -15,11 +14,5 @@
"lazypipe": "^1.0.1",
"gulp-uglify": "^1.2.0",
"minimist": "^1.1.1"
},
"devDependencies": {},
"scripts": {
"test": "gulp"
},
"author": "",
"license": "ISC"
}
}
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