Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring ads management on admin #3

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0ab6191
Add dist folder to git ignore files
diadzine Oct 30, 2015
b3f9ff3
Add npm debug log to git ignore files
diadzine Oct 30, 2015
e204b53
Changed script imports
diadzine Oct 30, 2015
2abff0b
add bootstrap-select to dependancies
diadzine Mar 14, 2016
5e9f800
add new ad form
diadzine Mar 14, 2016
4367cfd
add gulpfile to replace grunt
diadzine Jul 28, 2016
96a0a63
update git ignore file
diadzine Jul 28, 2016
8ecf823
grunt to gulp migration
diadzine Jul 28, 2016
074db0f
add .publish folder to git ignore files
diadzine Jul 28, 2016
599e98d
changes on git ignore file
diadzine Aug 2, 2016
038a232
fix AngularJS Dependancies Injection
diadzine Sep 3, 2016
0962279
Merge branch 'master' of https://bitbucket.org/ab_tooskich/admin
diadzine Sep 3, 2016
8015ffc
update angular packages versions
diadzine Sep 4, 2016
fd3cfda
fix typos
diadzine Sep 4, 2016
0bc8c95
change dev and prod ports to 8081 and 8082
diadzine Sep 7, 2016
6eb76f5
change bower-components paths
diadzine Sep 7, 2016
a42e80a
Fix bug in tsImageUpload directive
diadzine Sep 9, 2016
f6ea1ad
Fix sponsor bug in blog.html
diadzine Sep 9, 2016
6343ea3
clean console log in News controller
diadzine Sep 9, 2016
3256e33
Change in gulpfile for js files watching
diadzine Sep 9, 2016
4bb1aca
Merge branch 'master' of https://bitbucket.org/ab_tooskich/admin
diadzine Sep 9, 2016
6ee2ec1
replace Mag with St. Moritz 2017
diadzine Nov 17, 2016
0ef9436
Merge branch 'master' of github.com:diadzine/admin
diadzine Mar 15, 2017
e7425f4
disable 'St. Moritz 2017' checkbox on News form page
diadzine Mar 15, 2017
a0c0963
fix removed checkbox issue
diadzine Mar 15, 2017
b818b06
Fix TinyMCE editor issue by finding a CDN which fixing TinyMCE versio…
diadzine May 19, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add gulpfile to replace grunt
diadzine committed Jul 28, 2016
commit 4367cfd97bf9145a0d07176405e1a9ab27e86913
181 changes: 181 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
var gulp = require('gulp');

// Load plugins
var $ = require('gulp-load-plugins')();

// Config
var config = {

 bowerDir: './app/bower_components'
,
buildPath: './dist',

 cssPath: './dist/styles',
fontsPath: './app/fonts',

 htmlPath: './app',
imagesPath: './app/images',

 jsPath: './app/scripts',

 sassPath: './app/styles',
}

gulp.task('connectDev', function () {
$.connect.server({
root: ['app', 'tmp'],
port: 8001,
livereload: true
});
});

gulp.task('connectDist', function () {
$.connect.server({
root: 'dist',
port: 8002,
livereload: true
});
});

gulp.task('bower', function() {

return $.bower({
interactive: true
})

 .pipe(gulp.dest(config.bowerDir))
;
});

gulp.task('bower-components', function() {

return gulp.src(config.htmlPath + '/bower_components/**/*')

 .pipe(gulp.dest(config.buildPath + '/bower_components'))
;
});

gulp.task('fonts', function () {
return gulp.src(config.fontsPath + '/*.ttf')
.pipe(gulp.dest(config.buildPath + '/fonts'))
.pipe($.connect.reload());
});

gulp.task('html', function () {
return gulp.src([
config.htmlPath + '/**/*.html',
'!' + config.htmlPath + '/bower_components/**/*.html'
])
.pipe($.useref())
.pipe($.if('*.js', $.uglify()))
.pipe($.if('*.css', $.cleanCss()))
.pipe(gulp.dest(config.buildPath))
.pipe($.connect.reload());
});

gulp.task('images', function () {
return gulp.src([config.imagesPath + '/**/*.{gif,ico,jpg,png,svg}'])
.pipe(gulp.dest(config.buildPath + '/images'))
.pipe($.connect.reload());
});

gulp.task('misc', function () {
return gulp.src([
config.htmlPath + '/favicon.ico',
config.htmlPath + '/robots.txt'
])
.pipe($.cache(gulp.dest(config.buildPath)))
.pipe($.connect.reload());
});

gulp.task('styles', function () {
return gulp.src(config.sassPath + '/main.scss')
.pipe($.sass({
style: 'expanded',
loadPath: [
config.sassPath,
config.bowerDir
]
}))
.pipe($.autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe($.cache(gulp.dest(config.sassPath)))
.pipe($.cleanCss())
.pipe($.cache(gulp.dest(config.cssPath)))
.pipe($.connect.reload());
});

// gulp.task('scripts', function () {
// return gulp.src(config.jsPath + '/**/*.js')
// .pipe($.concat('scripts.js'))
// .pipe($.rename({suffix: '.min'}))
// .pipe($.uglify())
// .pipe($.cache(gulp.dest(config.buildPath + '/scripts')))
// .pipe($.rev())
// .pipe($.cache(gulp.dest(config.buildPath + '/scripts')))
// .pipe($.rev.manifest(config.buildPath + '/rev-manifest.json', {
// base: config.buildPath,
// merge: true
// }))
// .pipe($.cache(gulp.dest(config.buildPath)))
// .pipe($.connect.reload());
// });

gulp.task("revision", ["styles", "html"], function(){
return gulp.src(["dist/**/*.css", "dist/**/*.js"])
.pipe($.rev())
.pipe(gulp.dest(config.buildPath))
.pipe($.rev.manifest())
.pipe(gulp.dest(config.buildPath))
})

gulp.task("revreplace", ["revision"], function(){
var manifest = gulp.src(config.buildPath + "/rev-manifest.json");

return gulp.src(config.buildPath + "/index.html")
.pipe($.revReplace({manifest: manifest}))
.pipe(gulp.dest(config.buildPath));
});

gulp.task('watch', function () {
// Watch font files
gulp.watch([config.fontsPath + '/*'], ['fonts']);

// Watch .html files
gulp.watch([
config.htmlPath + '/**/*.html',
config.htmlPath + '/favicon.ico',
config.htmlPath + '/robots.txt'
], ['html']);

// Watch images
gulp.watch([config.imagesPath + '/**/*.{gif,ico,jpg,png,svg}'], ['images']);

// Watch misc files
gulp.watch([
config.htmlPath + '/favicon.ico',
config.htmlPath + '/robots.txt'
], ['misc']);

// Watch .scss files
gulp.watch([config.sassPath + '/**/*.scss'], ['styles']);

// Watch .js files
// gulp.watch(config.jsPath + '/**/*.js', ['scripts']);
});

gulp.task('clean-cache', function () {
return $.cache.clearAll();
});

gulp.task('clean', ['clean-cache'], function () {
return gulp.src(config.buildPath + '/*', {read: false})
.pipe($.rimraf());
});

// Build
gulp.task('build', ['clean'], function () {
gulp.run('bower', 'bower-components', 'fonts', 'html', 'images', 'styles', 'revreplace');
});

// Deploy on gh-pages branch
gulp.task('deploy', function() {
return gulp.src(config.buildPath + '/**/*')
.pipe($.ghPages());
});

// Dist serve
gulp.task('serve', ['connectDist']);

// Default task
gulp.task('default', ['connectDev', 'build', 'watch']);