From e706f321ce69695045b339520004f2eb0c14f6c0 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 30 Aug 2015 14:02:02 +0200 Subject: [PATCH 1/6] new build & CI setup --- .ci/build.sh | 13 ++++ .ci/deploy.sh | 9 +++ .ci/setup.sh | 8 +++ .travis.yml | 33 +++++----- README.md | 5 +- gulpfile.js | 171 +++++++++++++++++++------------------------------- package.json | 3 + 7 files changed, 119 insertions(+), 123 deletions(-) create mode 100755 .ci/build.sh create mode 100755 .ci/deploy.sh create mode 100755 .ci/setup.sh diff --git a/.ci/build.sh b/.ci/build.sh new file mode 100755 index 00000000..2f2202c0 --- /dev/null +++ b/.ci/build.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +if [ $TRAVIS_BRANCH == "master" ]; then + + gulp build --production + +else + + gulp build + +fi; + +exit; diff --git a/.ci/deploy.sh b/.ci/deploy.sh new file mode 100755 index 00000000..acdfedc7 --- /dev/null +++ b/.ci/deploy.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e; + +gulp s3:assets + +gulp cdn + +rsync --recursive --delete --delete-excluded --checksum --verbose -e "ssh" $TRAVIS_BUILD_DIR/_site/ kremalicious.com@ftp.kremalicious.com:/nfs/c08/h04/mnt/126308/domains/kremalicious.com/html/ diff --git a/.ci/setup.sh b/.ci/setup.sh new file mode 100755 index 00000000..f98e24f0 --- /dev/null +++ b/.ci/setup.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e; + +npm install gulp bower -g +npm install +bower install +bundle install diff --git a/.travis.yml b/.travis.yml index 387986b3..d7b0b2a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,24 @@ sudo: false language: ruby rvm: -- 2.2.2 -- 1.9.3 -cache: bundler + - 2.2.2 + - 1.9.3 +cache: + bundler: true + directories: + - node_modules + - bower_components addons: - apt: - packages: - - libgsl0-dev -before_script: -- npm install gulp bower -g -- npm install -- bower install -- bundle install -script: gulp build + apt: + packages: + - libgsl0-dev +before_script: .ci/setup.sh +script: .ci/build.sh +# deploy: +# provider: script +# script: .ci/deploy.sh +# on: +# branch: master notifications: - slack: - secure: Ki6tFSrxaUnAugBFnmM2ydI/38/Ahyoaf9lhohoOCNnPk/QIYrI8MBlBXNVI04v2GOhFTvVljY5yJPlzrAUjH3eu34f6ObBe6rh3LjfvtE9eA94pBoSLJE/eSqB6FUBr324kxXpsWHRv93gyQ9I6Hk2CURv58de2z9Ytkwu2Epo= + slack: + secure: Ki6tFSrxaUnAugBFnmM2ydI/38/Ahyoaf9lhohoOCNnPk/QIYrI8MBlBXNVI04v2GOhFTvVljY5yJPlzrAUjH3eu34f6ObBe6rh3LjfvtE9eA94pBoSLJE/eSqB6FUBr324kxXpsWHRv93gyQ9I6Hk2CURv58de2z9Ytkwu2Epo= diff --git a/README.md b/README.md index bac5433e..e04e3db7 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ kremalicious3 > [kremalicious.com](http://kremalicious.com) based on [Jekyll](http://jekyllrb.com). Neat. [ ![Codeship Status for kremalicious/kremalicious3](https://www.codeship.io/projects/f6973090-9f04-0131-a2b7-625e8177ce9a/status?branch=master)](https://www.codeship.io/projects/18092) +[![Build Status](https://travis-ci.org/kremalicious/kremalicious3.svg?branch=master)](https://travis-ci.org/kremalicious/kremalicious3) [![Dependency Status](https://gemnasium.com/kremalicious/kremalicious3.svg)](https://gemnasium.com/kremalicious/kremalicious3) @@ -41,7 +42,7 @@ Run the following command from the repository's root folder to install all depen npm install && bower install && bundle install ``` -### Development build +### Development server This generates the site and assets and starts a local dev server combined with a livereloading watch task under `http://localhost:1337`. @@ -54,7 +55,7 @@ gulp Runs almost the same tasks as `gulp server` but additionally versions all assets and optimizes all image assets. ```bash -gulp build +gulp build --production ``` diff --git a/gulpfile.js b/gulpfile.js index 2dbb5ffd..e9e1e09a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,7 +7,8 @@ var gulp = require('gulp'), chalk = require('chalk'), merge = require('merge-stream'), pkg = require('./package.json'), - parallelize = require('concurrent-transform'); + parallelize = require('concurrent-transform'), + revAll = require('gulp-rev-all'); // Temporary solution until gulp 4 // https://github.com/gulpjs/gulp/issues/355 @@ -19,6 +20,9 @@ var onError = function(error) { this.emit('end'); } +// 'development' is just default, production overrides are triggered +// by adding the production flag to the gulp command e.g. `gulp build --production` +var isProduction = ($.util.env.production === true ? true : false); // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // Terminal Banner @@ -44,6 +48,8 @@ var src = '_src', s3path = '/', s3region = 'eu-central-1'; +var manifest = gulp.src(dist + '/assets/rev-manifest.json'); + // icons var icons = { entypo: { @@ -109,20 +115,37 @@ gulp.task('clean', function(cb) { // gulp.task('jekyll', function(cb) { var spawn = require('child_process').spawn; - var jekyll = spawn('bundle', ['exec', 'jekyll', 'build', '--drafts', '--future'], { stdio: 'inherit' }); + + if (isProduction) { + var jekyll = spawn('bundle', ['exec', 'jekyll', 'build', '--lsi'], { stdio: 'inherit' }); + } else { + var jekyll = spawn('bundle', ['exec', 'jekyll', 'build', '--drafts', '--future'], { stdio: 'inherit' }); + } jekyll.on('exit', function(code) { cb(code === 0 ? null : 'ERROR: Jekyll process exited with code: ' + code); }); }); -gulp.task('jekyll:production', function(cb) { - var spawn = require('child_process').spawn; - var jekyll = spawn('bundle', ['exec', 'jekyll', 'build', '--lsi'], { stdio: 'inherit' }); - jekyll.on('exit', function(code) { - cb(code === 0 ? null : 'ERROR: Jekyll process exited with code: ' + code); - }); +// +// HTML +// +gulp.task('html', function() { + return gulp.src(dist + '/**/*.html') + .pipe($.if(isProduction, $.uglify())).on('error', onError) + .pipe($.if(isProduction, $.htmlmin({ + collapseWhitespace: true, + conservativeCollapse: true, + removeComments: true, + useShortDoctype: true, + collapseBooleanAttributes: true, + removeRedundantAttributes: true, + removeEmptyAttributes: true, + removeEmptyAttributes: true + }))) + //.pipe($.if(isProduction, revAll())) + .pipe(gulp.dest(dist)) }); @@ -136,7 +159,11 @@ gulp.task('css', function() { ]) .pipe($.stylus({ 'include css': true })).on('error', onError) .pipe($.autoprefixer({ browsers: 'last 2 versions' })).on('error', onError) + .pipe($.if(isProduction, $.combineMq({ beautify: false }))) + .pipe($.if(isProduction, $.cssmin())) + .pipe($.if(isProduction, $.header(banner, { pkg: pkg }))) .pipe($.rename({ suffix: '.min' })) + //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(dist + '/assets/css/')) .pipe($.connect.reload()) }); @@ -151,7 +178,9 @@ gulp.task('js:libraries', function() { return gulp.src([ 'node_modules/picturefill/dist/picturefill.js' ]) + .pipe($.if(isProduction, $.uglify())).on('error', onError) .pipe($.rename({ suffix: '.min'})) + //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(dist + '/assets/js/')) }); @@ -160,6 +189,9 @@ gulp.task('js:project', function() { return gulp.src(src + '/_assets/js/*.js') .pipe($.include()).on('error', onError) .pipe($.concat('kremalicious3.min.js')) + .pipe($.if(isProduction, $.uglify())).on('error', onError) + .pipe($.if(isProduction, $.header(banner, { pkg: pkg }))) + //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(dist + '/assets/js/')) .pipe($.connect.reload()) }); @@ -183,22 +215,13 @@ gulp.task('icons', function() { .pipe($.rename({ prefix: iconset.prefix })) .pipe(gulp.dest(iconset.dist)) .pipe($.filter('**/*.svg')) - .pipe($.imagemin({ svgoPlugins: [{ removeViewBox: false }] })) + .pipe($.if(isProduction, $.imagemin({ svgoPlugins: [{ removeViewBox: false }] }))) .pipe($.svgSprite(spriteConfig)) + //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(iconset.dist)) }); -// -// Generate SVG fallbacks -// -gulp.task('svg:fallbacks', function() { - return gulp.src(dist + '/assets/img/*.svg') - .pipe($.svg2png()).on('error', onError) - .pipe(gulp.dest(dist + '/assets/img/')) -}); - - // // Copy images // @@ -207,6 +230,14 @@ gulp.task('images', function() { src + '/_assets/img/**/*', '!' + src + '/_assets/img/entypo/**/*' ]) + .pipe($.if(isProduction, $.imagemin({ + optimizationLevel: 5, // png + progressive: true, // jpg + interlaced: true, // gif + multipass: true, // svg + svgoPlugins: [{ removeViewBox: false }] + }))) + //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(dist + '/assets/img/')) }); @@ -216,6 +247,7 @@ gulp.task('images', function() { // gulp.task('fonts', function() { return gulp.src(src + '/_assets/fonts/**/*') + //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(dist + '/assets/fonts/')) }); @@ -229,72 +261,10 @@ gulp.task('media', function() { }); -// -// Optimize css -// -gulp.task('optimize:css', function() { - return gulp.src(dist + '/assets/css/*.css') - .pipe($.combineMq({ beautify: false })) - .pipe($.cssmin()) - .pipe($.header(banner, { pkg: pkg })) - .pipe(gulp.dest(dist + '/assets/css/')) -}); - - -// -// Optimize js -// -gulp.task('optimize:js', function() { - return gulp.src(dist + '/assets/js/*.js') - .pipe($.uglify()).on('error', onError) - .pipe($.header(banner, { pkg: pkg })) - .pipe(gulp.dest(dist + '/assets/js/')) -}); - - -// -// Optimize HTML -// -gulp.task('optimize:html', function() { - return gulp.src(dist + '/**/*.html') - .pipe($.htmlmin({ - collapseWhitespace: true, - conservativeCollapse: true, - removeComments: true, - useShortDoctype: true, - collapseBooleanAttributes: true, - removeRedundantAttributes: true, - removeEmptyAttributes: true, - removeEmptyAttributes: true - })) - .pipe(gulp.dest(dist)) -}); - - -// -// Optimize images -// -gulp.task('optimize:images', function() { - return gulp.src([ - dist + '/**/*.{png,jpg,jpeg,gif,svg,webp}', - '!' + dist + '/media/**/*', - '!' + dist + '/assets/img/sprite*' - ]) - .pipe($.cache($.imagemin({ - optimizationLevel: 5, // png - progressive: true, // jpg - interlaced: true, // gif - multipass: true, // svg - svgoPlugins: [{ removeViewBox: false }] - }))) - .pipe(gulp.dest(dist)) -}); - - // // Revision static assets // -gulp.task('revision', function() { +gulp.task('rev', function() { return gulp.src(dist + '/assets/**/*.{css,js,png,jpg,jpeg,svg,eot,ttf,woff}') .pipe($.rev()) .pipe(gulp.dest(dist + '/assets/')) @@ -308,7 +278,7 @@ gulp.task('revision', function() { // Replace all links to assets in files // from a manifest file // -gulp.task('revision:replace', function() { +gulp.task('rev:replace', function() { var manifest = gulp.src(dist + '/assets/rev-manifest.json'); @@ -387,54 +357,41 @@ gulp.task('connect', function() { // gulp.task('watch', function() { gulp.watch([src + '/_assets/styl/**/*.styl'], ['css']) - gulp.watch([src + '/_assets/js/*.js'], ['js:project']) + gulp.watch([src + '/_assets/js/*.js'], ['js']) gulp.watch([src + '/_assets/img/**/*.{png,jpg,jpeg,gif}'], ['images']) gulp.watch([src + '/_assets/img/**/*.{svg}'], ['icons']) gulp.watch([src + '/_media/**/*'], ['media']) - gulp.watch([src + '/**/*.{html,xml,json,txt,md}'], ['jekyll-build']) + gulp.watch([src + '/**/*.{html,xml,json,txt,md}'], ['jekyll']) }); // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // Task sequences // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -gulp.task('jekyll-build', function(cb) { - runSequence( - 'jekyll', - ['css', 'js', 'images', 'fonts', 'media'], - 'icons', - cb - ); -}); // // Dev Server // gulp.task('default', function(cb) { runSequence( - 'clean', - 'jekyll-build', - 'watch', - 'connect', + 'build', + ['watch', 'connect'], cb ); }); + // -// Production build +// Full build // gulp.task('build', function(cb) { + + console.log(chalk.green('Building ' + ($.util.env.production ? 'production' : 'dev') + ' version...')); + runSequence( 'clean', - 'jekyll:production', - ['css', 'js', 'images', 'fonts', 'media'], - 'icons', - 'svg:fallbacks', - 'revision', - 'revision:replace', - 'cdn', - ['optimize:html', 'optimize:images', 'optimize:css', 'optimize:js'], - 's3:assets', + 'jekyll', + ['css', 'js', 'images', 'icons', 'fonts', 'media', 'html'], cb ); }); diff --git a/package.json b/package.json index 7506ddbf..47a91513 100644 --- a/package.json +++ b/package.json @@ -34,18 +34,21 @@ "gulp-filter": "^2.0.2", "gulp-header": ">=1.2.2", "gulp-htmlmin": ">=1.1.2", + "gulp-if": "^1.2.5", "gulp-imagemin": ">=2.2.1", "gulp-include": ">=2.0.2", "gulp-load-plugins": ">=0.10.0", "gulp-rename": ">=1.2.2", "gulp-replace": ">=0.5.3", "gulp-rev": ">=4.0.0", + "gulp-rev-all": "^0.8.21", "gulp-rev-replace": ">=0.4.1", "gulp-stylus": ">=2.0.3", "gulp-svg-sprite": ">=1.2.2", "gulp-svg2png": ">=0.3.0", "gulp-uglify": ">=1.2.0", "gulp-uncss": ">=1.0.1", + "gulp-util": "^3.0.6", "merge-stream": ">=0.1.7", "run-sequence": ">=1.1.0", "stylus": ">=0.45.0", From a6f41558cd9ba323d0dfd54b5efb7443daaeb297 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 30 Aug 2015 15:05:08 +0200 Subject: [PATCH 2/6] final build stuff --- .ci/build.sh | 4 ---- .ci/deploy.sh | 1 - README.md | 4 +--- gulpfile.js | 39 +++++++++++++++------------------------ package.json | 9 ++++----- 5 files changed, 20 insertions(+), 37 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 2f2202c0..2184ed02 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -1,13 +1,9 @@ #!/usr/bin/env bash if [ $TRAVIS_BRANCH == "master" ]; then - gulp build --production - else - gulp build - fi; exit; diff --git a/.ci/deploy.sh b/.ci/deploy.sh index acdfedc7..8983ad15 100755 --- a/.ci/deploy.sh +++ b/.ci/deploy.sh @@ -3,7 +3,6 @@ set -e; gulp s3:assets - gulp cdn rsync --recursive --delete --delete-excluded --checksum --verbose -e "ssh" $TRAVIS_BUILD_DIR/_site/ kremalicious.com@ftp.kremalicious.com:/nfs/c08/h04/mnt/126308/domains/kremalicious.com/html/ diff --git a/README.md b/README.md index e04e3db7..e996650c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ npm install && bower install && bundle install ### Development server -This generates the site and assets and starts a local dev server combined with a livereloading watch task under `http://localhost:1337`. +This generates the site with the dev build task `gulp build` and starts a local dev server combined with a livereloading watch task under `http://localhost:1337`. ```bash gulp @@ -52,8 +52,6 @@ gulp ### Production build -Runs almost the same tasks as `gulp server` but additionally versions all assets and optimizes all image assets. - ```bash gulp build --production ``` diff --git a/gulpfile.js b/gulpfile.js index e9e1e09a..355a62bc 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,8 +7,7 @@ var gulp = require('gulp'), chalk = require('chalk'), merge = require('merge-stream'), pkg = require('./package.json'), - parallelize = require('concurrent-transform'), - revAll = require('gulp-rev-all'); + parallelize = require('concurrent-transform'); // Temporary solution until gulp 4 // https://github.com/gulpjs/gulp/issues/355 @@ -41,15 +40,13 @@ console.log(""); // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // paths -var src = '_src', - dist = '_site', - cdn = 'https://cdn.kremalicious.com', +var src = '_src', + dist = '_site', + cdn = 'https://cdn.kremalicious.com', s3bucket = 'kremalicious.com', s3path = '/', s3region = 'eu-central-1'; -var manifest = gulp.src(dist + '/assets/rev-manifest.json'); - // icons var icons = { entypo: { @@ -133,7 +130,6 @@ gulp.task('jekyll', function(cb) { // gulp.task('html', function() { return gulp.src(dist + '/**/*.html') - .pipe($.if(isProduction, $.uglify())).on('error', onError) .pipe($.if(isProduction, $.htmlmin({ collapseWhitespace: true, conservativeCollapse: true, @@ -144,7 +140,6 @@ gulp.task('html', function() { removeEmptyAttributes: true, removeEmptyAttributes: true }))) - //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(dist)) }); @@ -163,7 +158,6 @@ gulp.task('css', function() { .pipe($.if(isProduction, $.cssmin())) .pipe($.if(isProduction, $.header(banner, { pkg: pkg }))) .pipe($.rename({ suffix: '.min' })) - //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(dist + '/assets/css/')) .pipe($.connect.reload()) }); @@ -176,12 +170,11 @@ gulp.task('css', function() { // Libraries gulp.task('js:libraries', function() { return gulp.src([ - 'node_modules/picturefill/dist/picturefill.js' - ]) - .pipe($.if(isProduction, $.uglify())).on('error', onError) - .pipe($.rename({ suffix: '.min'})) - //.pipe($.if(isProduction, revAll())) - .pipe(gulp.dest(dist + '/assets/js/')) + 'node_modules/picturefill/dist/picturefill.js' + ]) + .pipe($.if(isProduction, $.uglify())).on('error', onError) + .pipe($.rename({ suffix: '.min'})) + .pipe(gulp.dest(dist + '/assets/js/')) }); // Project js @@ -191,7 +184,6 @@ gulp.task('js:project', function() { .pipe($.concat('kremalicious3.min.js')) .pipe($.if(isProduction, $.uglify())).on('error', onError) .pipe($.if(isProduction, $.header(banner, { pkg: pkg }))) - //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(dist + '/assets/js/')) .pipe($.connect.reload()) }); @@ -217,7 +209,6 @@ gulp.task('icons', function() { .pipe($.filter('**/*.svg')) .pipe($.if(isProduction, $.imagemin({ svgoPlugins: [{ removeViewBox: false }] }))) .pipe($.svgSprite(spriteConfig)) - //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(iconset.dist)) }); @@ -237,7 +228,6 @@ gulp.task('images', function() { multipass: true, // svg svgoPlugins: [{ removeViewBox: false }] }))) - //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(dist + '/assets/img/')) }); @@ -247,7 +237,6 @@ gulp.task('images', function() { // gulp.task('fonts', function() { return gulp.src(src + '/_assets/fonts/**/*') - //.pipe($.if(isProduction, revAll())) .pipe(gulp.dest(dist + '/assets/fonts/')) }); @@ -266,10 +255,10 @@ gulp.task('media', function() { // gulp.task('rev', function() { return gulp.src(dist + '/assets/**/*.{css,js,png,jpg,jpeg,svg,eot,ttf,woff}') - .pipe($.rev()) + .pipe($.if(isProduction, $.rev())) .pipe(gulp.dest(dist + '/assets/')) // output rev manifest for next replace task - .pipe($.rev.manifest()) + .pipe($.if(isProduction, $.rev.manifest())) .pipe(gulp.dest(dist + '/assets/')) }); @@ -283,7 +272,7 @@ gulp.task('rev:replace', function() { var manifest = gulp.src(dist + '/assets/rev-manifest.json'); return gulp.src(dist + '/**/*.{html,xml,txt,json,css,js,png,jpg,jpeg,svg,eot,ttf,woff}') - .pipe($.revReplace({ manifest: manifest })) + .pipe($.if(isProduction, $.revReplace({ manifest: manifest }))) .pipe(gulp.dest(dist)) }); @@ -391,7 +380,9 @@ gulp.task('build', function(cb) { runSequence( 'clean', 'jekyll', - ['css', 'js', 'images', 'icons', 'fonts', 'media', 'html'], + ['html', 'css', 'js', 'images', 'icons', 'fonts', 'media'], + 'rev', + 'rev:replace', cb ); }); diff --git a/package.json b/package.json index 47a91513..8f9f41fd 100644 --- a/package.json +++ b/package.json @@ -31,28 +31,27 @@ "gulp-concat": ">=2.5.2", "gulp-connect": ">=2.0.5", "gulp-cssmin": ">=0.1.7", - "gulp-filter": "^2.0.2", + "gulp-filter": ">=2.0.2", "gulp-header": ">=1.2.2", "gulp-htmlmin": ">=1.1.2", - "gulp-if": "^1.2.5", + "gulp-if": ">=1.2.5", "gulp-imagemin": ">=2.2.1", "gulp-include": ">=2.0.2", "gulp-load-plugins": ">=0.10.0", "gulp-rename": ">=1.2.2", "gulp-replace": ">=0.5.3", "gulp-rev": ">=4.0.0", - "gulp-rev-all": "^0.8.21", "gulp-rev-replace": ">=0.4.1", "gulp-stylus": ">=2.0.3", "gulp-svg-sprite": ">=1.2.2", "gulp-svg2png": ">=0.3.0", "gulp-uglify": ">=1.2.0", "gulp-uncss": ">=1.0.1", - "gulp-util": "^3.0.6", + "gulp-util": ">=3.0.6", "merge-stream": ">=0.1.7", "run-sequence": ">=1.1.0", "stylus": ">=0.45.0", - "vinyl": "^0.4.6" + "vinyl": ">=0.4.6" }, "engines": { "node": ">=0.10.29" From 2b63b30098f0cbb52ae81f2ac435c2e1764948e9 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 30 Aug 2015 15:16:36 +0200 Subject: [PATCH 3/6] cache generated images folder --- .ci/setup.sh | 10 ++++++++++ .travis.yml | 1 + 2 files changed, 11 insertions(+) diff --git a/.ci/setup.sh b/.ci/setup.sh index f98e24f0..a1876915 100755 --- a/.ci/setup.sh +++ b/.ci/setup.sh @@ -2,7 +2,17 @@ set -e; +echo "$(tput setaf 136)" +echo " Installing dependencies " +echo "=============================================" +echo "$(tput sgr0)" # reset + npm install gulp bower -g npm install bower install bundle install + +echo "$(tput setaf 64)" # green +echo "---------------------------------------------" +echo " ✓ done installing dependencies" +echo "$(tput sgr0)" # reset diff --git a/.travis.yml b/.travis.yml index d7b0b2a5..57cf9eac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ cache: directories: - node_modules - bower_components + - _site/media/gen addons: apt: packages: From 91cb4bd14caadd9e96f4bab9c6a0c981d464ab38 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 30 Aug 2015 15:55:36 +0200 Subject: [PATCH 4/6] activate travis deployment --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 57cf9eac..f60bf0d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,11 +15,11 @@ addons: - libgsl0-dev before_script: .ci/setup.sh script: .ci/build.sh -# deploy: -# provider: script -# script: .ci/deploy.sh -# on: -# branch: master +deploy: + provider: script + script: .ci/deploy.sh + on: + branch: master notifications: slack: secure: Ki6tFSrxaUnAugBFnmM2ydI/38/Ahyoaf9lhohoOCNnPk/QIYrI8MBlBXNVI04v2GOhFTvVljY5yJPlzrAUjH3eu34f6ObBe6rh3LjfvtE9eA94pBoSLJE/eSqB6FUBr324kxXpsWHRv93gyQ9I6Hk2CURv58de2z9Ytkwu2Epo= From e4c49cc53ab4f370f2fa48ba7dbd15a499522f95 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 30 Aug 2015 16:06:04 +0200 Subject: [PATCH 5/6] remove codeship badge --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e996650c..34708455 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ kremalicious3 > [kremalicious.com](http://kremalicious.com) based on [Jekyll](http://jekyllrb.com). Neat. -[ ![Codeship Status for kremalicious/kremalicious3](https://www.codeship.io/projects/f6973090-9f04-0131-a2b7-625e8177ce9a/status?branch=master)](https://www.codeship.io/projects/18092) [![Build Status](https://travis-ci.org/kremalicious/kremalicious3.svg?branch=master)](https://travis-ci.org/kremalicious/kremalicious3) [![Dependency Status](https://gemnasium.com/kremalicious/kremalicious3.svg)](https://gemnasium.com/kremalicious/kremalicious3) From 3047a1a29ba0f3173479fc41ab3326863a894554 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 31 Aug 2015 19:35:31 +0200 Subject: [PATCH 6/6] nicer deploy UI --- .ci/deploy.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.ci/deploy.sh b/.ci/deploy.sh index 8983ad15..48c46ac8 100755 --- a/.ci/deploy.sh +++ b/.ci/deploy.sh @@ -2,7 +2,28 @@ set -e; +echo "$(tput setaf 136)" +echo " Starting assets CDN " +echo "=============================================" +echo "$(tput sgr0)" # reset + gulp s3:assets gulp cdn +echo "$(tput setaf 64)" # green +echo "---------------------------------------------" +echo " ✓ done assets CDN" +echo "$(tput sgr0)" # reset + + +echo "$(tput setaf 136)" +echo " Starting rsync deployment " +echo "=============================================" +echo "$(tput sgr0)" # reset + rsync --recursive --delete --delete-excluded --checksum --verbose -e "ssh" $TRAVIS_BUILD_DIR/_site/ kremalicious.com@ftp.kremalicious.com:/nfs/c08/h04/mnt/126308/domains/kremalicious.com/html/ + +echo "$(tput setaf 64)" # green +echo "---------------------------------------------" +echo " ✓ done rsync deployment " +echo "$(tput sgr0)" # reset