From 2111d2913b416c378c1903b7e7090597c7afa109 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Mon, 30 Jul 2018 11:59:05 +1000 Subject: [PATCH 1/6] Use commonjs requires instead of mixing imports/exports/requires --- manager/src/frontend/js/app/access/empty.js | 3 +-- manager/src/frontend/js/app/access/main.js | 3 +-- manager/src/frontend/js/app/access/row.js | 3 +-- manager/src/frontend/js/app/access_list/delete.js | 3 +-- manager/src/frontend/js/app/access_list/form.js | 3 +-- manager/src/frontend/js/app/access_list/item.js | 3 +-- manager/src/frontend/js/app/api.js | 2 +- manager/src/frontend/js/app/controller.js | 11 ++++++----- manager/src/frontend/js/app/dashboard/empty.js | 3 +-- manager/src/frontend/js/app/dashboard/main.js | 3 +-- manager/src/frontend/js/app/dashboard/row.js | 3 +-- manager/src/frontend/js/app/error/main.js | 3 +-- manager/src/frontend/js/app/host/404_form.js | 3 +-- manager/src/frontend/js/app/host/advanced.js | 3 +-- manager/src/frontend/js/app/host/delete.js | 3 +-- manager/src/frontend/js/app/host/proxy_form.js | 3 +-- manager/src/frontend/js/app/host/reconfigure.js | 3 +-- manager/src/frontend/js/app/host/redirection_form.js | 3 +-- manager/src/frontend/js/app/host/stream_form.js | 3 +-- manager/src/frontend/js/app/main.js | 7 +++---- manager/src/frontend/js/app/ui/header/main.js | 3 +-- manager/src/frontend/js/app/ui/main.js | 3 +-- manager/src/frontend/js/lib/helpers.js | 4 ++-- manager/src/frontend/js/lib/marionette.js | 4 ++-- manager/src/frontend/js/main.js | 4 ++-- manager/src/frontend/js/models/access.js | 2 +- manager/src/frontend/js/models/access_item.js | 2 +- manager/src/frontend/js/models/host.js | 2 +- 28 files changed, 38 insertions(+), 57 deletions(-) diff --git a/manager/src/frontend/js/app/access/empty.js b/manager/src/frontend/js/app/access/empty.js index bf2f06c0..6cc2631c 100644 --- a/manager/src/frontend/js/app/access/empty.js +++ b/manager/src/frontend/js/app/access/empty.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./empty.ejs'); const AccessModel = require('../../models/access'); const Controller = require('../controller'); diff --git a/manager/src/frontend/js/app/access/main.js b/manager/src/frontend/js/app/access/main.js index ac9929aa..89358fe7 100644 --- a/manager/src/frontend/js/app/access/main.js +++ b/manager/src/frontend/js/app/access/main.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const Api = require('../api'); const template = require('./main.ejs'); const Controller = require('../controller'); diff --git a/manager/src/frontend/js/app/access/row.js b/manager/src/frontend/js/app/access/row.js index 5570db44..e3a739f3 100644 --- a/manager/src/frontend/js/app/access/row.js +++ b/manager/src/frontend/js/app/access/row.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./row.ejs'); const Controller = require('../controller'); diff --git a/manager/src/frontend/js/app/access_list/delete.js b/manager/src/frontend/js/app/access_list/delete.js index 7062428b..d6e91b20 100644 --- a/manager/src/frontend/js/app/access_list/delete.js +++ b/manager/src/frontend/js/app/access_list/delete.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./delete.ejs'); const Controller = require('../controller'); const Api = require('../api'); diff --git a/manager/src/frontend/js/app/access_list/form.js b/manager/src/frontend/js/app/access_list/form.js index ac636f00..6c0d227c 100644 --- a/manager/src/frontend/js/app/access_list/form.js +++ b/manager/src/frontend/js/app/access_list/form.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const _ = require('lodash'); const template = require('./form.ejs'); const Controller = require('../controller'); diff --git a/manager/src/frontend/js/app/access_list/item.js b/manager/src/frontend/js/app/access_list/item.js index e707eba8..bb2ec23e 100644 --- a/manager/src/frontend/js/app/access_list/item.js +++ b/manager/src/frontend/js/app/access_list/item.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./item.ejs'); module.exports = Mn.View.extend({ diff --git a/manager/src/frontend/js/app/api.js b/manager/src/frontend/js/app/api.js index 3697a360..f9d7a893 100644 --- a/manager/src/frontend/js/app/api.js +++ b/manager/src/frontend/js/app/api.js @@ -1,6 +1,6 @@ 'use strict'; -import $ from 'jquery'; +const $ = require('jquery'); /** * @param {String} message diff --git a/manager/src/frontend/js/app/controller.js b/manager/src/frontend/js/app/controller.js index 2bf685b4..b2792895 100644 --- a/manager/src/frontend/js/app/controller.js +++ b/manager/src/frontend/js/app/controller.js @@ -1,8 +1,7 @@ 'use strict'; -import Backbone from 'backbone'; - -const Cache = require('./cache'); +const Backbone = require('backbone'); +const Cache = require('./cache'); module.exports = { @@ -21,8 +20,9 @@ module.exports = { * Dashboard */ showDashboard: function () { + let controller = this; require(['./main', './dashboard/main'], (App, View) => { - this.navigate('/'); + controller.navigate('/'); App.UI.showMainLoading(); let view = new View(); @@ -39,8 +39,9 @@ module.exports = { * Access */ showAccess: function () { + let controller = this; require(['./main', './access/main'], (App, View) => { - this.navigate('/access'); + controller.navigate('/access'); App.UI.showMainLoading(); let view = new View(); diff --git a/manager/src/frontend/js/app/dashboard/empty.js b/manager/src/frontend/js/app/dashboard/empty.js index 48d6b527..0c6dc081 100644 --- a/manager/src/frontend/js/app/dashboard/empty.js +++ b/manager/src/frontend/js/app/dashboard/empty.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./empty.ejs'); const HostModel = require('../../models/host'); const Controller = require('../controller'); diff --git a/manager/src/frontend/js/app/dashboard/main.js b/manager/src/frontend/js/app/dashboard/main.js index 7897a665..9c37c388 100644 --- a/manager/src/frontend/js/app/dashboard/main.js +++ b/manager/src/frontend/js/app/dashboard/main.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const Api = require('../api'); const template = require('./main.ejs'); const Controller = require('../controller'); diff --git a/manager/src/frontend/js/app/dashboard/row.js b/manager/src/frontend/js/app/dashboard/row.js index 0cefc940..43ff108f 100644 --- a/manager/src/frontend/js/app/dashboard/row.js +++ b/manager/src/frontend/js/app/dashboard/row.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./row.ejs'); const Controller = require('../controller'); const AccessListModel = require('../../models/access'); diff --git a/manager/src/frontend/js/app/error/main.js b/manager/src/frontend/js/app/error/main.js index 02e8d8b0..5051ce72 100644 --- a/manager/src/frontend/js/app/error/main.js +++ b/manager/src/frontend/js/app/error/main.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./main.ejs'); module.exports = Mn.View.extend({ diff --git a/manager/src/frontend/js/app/host/404_form.js b/manager/src/frontend/js/app/host/404_form.js index 8a6b3c07..f19a146d 100644 --- a/manager/src/frontend/js/app/host/404_form.js +++ b/manager/src/frontend/js/app/host/404_form.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const _ = require('lodash'); const template = require('./404_form.ejs'); const Controller = require('../controller'); diff --git a/manager/src/frontend/js/app/host/advanced.js b/manager/src/frontend/js/app/host/advanced.js index 76d71c52..378bf431 100644 --- a/manager/src/frontend/js/app/host/advanced.js +++ b/manager/src/frontend/js/app/host/advanced.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./advanced.ejs'); const Controller = require('../controller'); const Api = require('../api'); diff --git a/manager/src/frontend/js/app/host/delete.js b/manager/src/frontend/js/app/host/delete.js index 8a602310..5335d282 100644 --- a/manager/src/frontend/js/app/host/delete.js +++ b/manager/src/frontend/js/app/host/delete.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./delete.ejs'); const Controller = require('../controller'); const Api = require('../api'); diff --git a/manager/src/frontend/js/app/host/proxy_form.js b/manager/src/frontend/js/app/host/proxy_form.js index 7804b10c..0544be11 100644 --- a/manager/src/frontend/js/app/host/proxy_form.js +++ b/manager/src/frontend/js/app/host/proxy_form.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const _ = require('lodash'); const template = require('./proxy_form.ejs'); const Controller = require('../controller'); diff --git a/manager/src/frontend/js/app/host/reconfigure.js b/manager/src/frontend/js/app/host/reconfigure.js index 7f5e62f0..986d095e 100644 --- a/manager/src/frontend/js/app/host/reconfigure.js +++ b/manager/src/frontend/js/app/host/reconfigure.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./reconfigure.ejs'); const Api = require('../api'); const App = require('../main'); diff --git a/manager/src/frontend/js/app/host/redirection_form.js b/manager/src/frontend/js/app/host/redirection_form.js index a0d4fcd4..d47ee682 100644 --- a/manager/src/frontend/js/app/host/redirection_form.js +++ b/manager/src/frontend/js/app/host/redirection_form.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const _ = require('lodash'); const template = require('./redirection_form.ejs'); const Controller = require('../controller'); diff --git a/manager/src/frontend/js/app/host/stream_form.js b/manager/src/frontend/js/app/host/stream_form.js index fd0ff38e..6a623d94 100644 --- a/manager/src/frontend/js/app/host/stream_form.js +++ b/manager/src/frontend/js/app/host/stream_form.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const _ = require('lodash'); const template = require('./stream_form.ejs'); const Controller = require('../controller'); diff --git a/manager/src/frontend/js/app/main.js b/manager/src/frontend/js/app/main.js index bde70acc..90aac959 100644 --- a/manager/src/frontend/js/app/main.js +++ b/manager/src/frontend/js/app/main.js @@ -1,9 +1,8 @@ 'use strict'; -import $ from 'jquery'; -import _ from 'underscore'; -import Backbone from 'backbone'; - +const $ = require('jquery'); +const _ = require('underscore'); +const Backbone = require('backbone'); const Mn = require('../lib/marionette'); const Cache = require('./cache'); const Controller = require('./controller'); diff --git a/manager/src/frontend/js/app/ui/header/main.js b/manager/src/frontend/js/app/ui/header/main.js index 792ca571..6915d8fb 100644 --- a/manager/src/frontend/js/app/ui/header/main.js +++ b/manager/src/frontend/js/app/ui/header/main.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./main.ejs'); const Controller = require('../../controller'); diff --git a/manager/src/frontend/js/app/ui/main.js b/manager/src/frontend/js/app/ui/main.js index 38c6c947..e6ee3370 100644 --- a/manager/src/frontend/js/app/ui/main.js +++ b/manager/src/frontend/js/app/ui/main.js @@ -1,7 +1,6 @@ 'use strict'; -import Mn from 'backbone.marionette'; - +const Mn = require('backbone.marionette'); const template = require('./main.ejs'); const HeaderView = require('./header/main'); const Cache = require('../cache'); diff --git a/manager/src/frontend/js/lib/helpers.js b/manager/src/frontend/js/lib/helpers.js index cb6dd3f2..d19ccd99 100644 --- a/manager/src/frontend/js/lib/helpers.js +++ b/manager/src/frontend/js/lib/helpers.js @@ -1,7 +1,7 @@ 'use strict'; -import numeral from 'numeral'; -import moment from 'moment'; +const numeral = require('numeral'); +const moment = require('moment'); module.exports = { diff --git a/manager/src/frontend/js/lib/marionette.js b/manager/src/frontend/js/lib/marionette.js index 8758975f..76353486 100644 --- a/manager/src/frontend/js/lib/marionette.js +++ b/manager/src/frontend/js/lib/marionette.js @@ -1,7 +1,7 @@ 'use strict'; -import _ from 'underscore'; -import Mn from 'backbone.marionette'; +const _ = require('underscore'); +const Mn = require('backbone.marionette'); let render = Mn.Renderer.render; Mn.Renderer.render = function (template, data, view) { diff --git a/manager/src/frontend/js/main.js b/manager/src/frontend/js/main.js index bb260621..a4dda495 100644 --- a/manager/src/frontend/js/main.js +++ b/manager/src/frontend/js/main.js @@ -1,7 +1,7 @@ 'use strict'; -import promise from 'es6-promise'; -import $ from 'jquery'; +const promise = require('es6-promise'); +const $ = require('jquery'); global.jQuery = $; global.$ = $; diff --git a/manager/src/frontend/js/models/access.js b/manager/src/frontend/js/models/access.js index 5b6541a8..2ab7bdb2 100644 --- a/manager/src/frontend/js/models/access.js +++ b/manager/src/frontend/js/models/access.js @@ -1,6 +1,6 @@ 'use strict'; -import Backbone from 'backbone'; +const Backbone = require('backbone'); const model = Backbone.Model.extend({ idAttribute: '_id', diff --git a/manager/src/frontend/js/models/access_item.js b/manager/src/frontend/js/models/access_item.js index 0c9f6d13..b054d222 100644 --- a/manager/src/frontend/js/models/access_item.js +++ b/manager/src/frontend/js/models/access_item.js @@ -1,6 +1,6 @@ 'use strict'; -import Backbone from 'backbone'; +const Backbone = require('backbone'); const model = Backbone.Model.extend({ idAttribute: 'username', diff --git a/manager/src/frontend/js/models/host.js b/manager/src/frontend/js/models/host.js index 8856b3dd..5b52987a 100644 --- a/manager/src/frontend/js/models/host.js +++ b/manager/src/frontend/js/models/host.js @@ -1,6 +1,6 @@ 'use strict'; -import Backbone from 'backbone'; +const Backbone = require('backbone'); const model = Backbone.Model.extend({ idAttribute: '_id', From 3dee0eba4e2c7e52533fe20c21805bdb91353f63 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Mon, 30 Jul 2018 11:59:28 +1000 Subject: [PATCH 2/6] Upgraded to webpack4 --- manager/.babelrc | 12 +++++++++++ manager/gulpfile.js | 27 ++++++++++++----------- manager/package.json | 11 +++++----- manager/webpack.config.js | 45 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 76 insertions(+), 19 deletions(-) create mode 100644 manager/.babelrc diff --git a/manager/.babelrc b/manager/.babelrc new file mode 100644 index 00000000..313497cf --- /dev/null +++ b/manager/.babelrc @@ -0,0 +1,12 @@ +{ + "presets": [ + ["env", { + "targets": { + "browsers": ["Chrome >= 65"] + }, + "debug": false, + "modules": false, + "useBuiltIns": "usage" + }] + ] +} diff --git a/manager/gulpfile.js b/manager/gulpfile.js index 41f3d0c1..7a6694d8 100644 --- a/manager/gulpfile.js +++ b/manager/gulpfile.js @@ -2,18 +2,19 @@ 'use strict'; -const path = require('path'); -const gulp = require('gulp'); -const gutil = require('gulp-util'); -const concat = require('gulp-concat-util'); -const runSequence = require('run-sequence'); -const webpack = require('webpack-stream'); -const imagemin = require('gulp-imagemin'); -const del = require('del'); -const bump = require('gulp-bump'); -const sass = require('gulp-sass'); -const ejs = require('gulp-ejs'); -const PACKAGE = require('./package.json'); +const path = require('path'); +const gulp = require('gulp'); +const gutil = require('gulp-util'); +const concat = require('gulp-concat-util'); +const runSequence = require('run-sequence'); +const webpack = require('webpack'); +const webpackStream = require('webpack-stream'); +const imagemin = require('gulp-imagemin'); +const del = require('del'); +const bump = require('gulp-bump'); +const sass = require('gulp-sass'); +const ejs = require('gulp-ejs'); +const PACKAGE = require('./package.json'); const assets = { views: { @@ -123,7 +124,7 @@ gulp.task('scss', function () { */ gulp.task('js', function () { return gulp.src(assets.js.src) - .pipe(webpack(require('./webpack.config.js'))) + .pipe(webpackStream(require('./webpack.config.js'), webpack)) .pipe(gulp.dest(assets.js.dest)) .on('error', handleError); }); diff --git a/manager/package.json b/manager/package.json index 9673c85c..0f2df432 100644 --- a/manager/package.json +++ b/manager/package.json @@ -19,10 +19,10 @@ "winston": "^2.4.0" }, "devDependencies": { - "@babel/core": "^7.0.0-beta.31", - "@babel/preset-env": "^7.0.0-beta.31", - "@babel/preset-es2015": "^7.0.0-beta.32", - "babel-loader": "^8.0.0-beta.0", + "babel-core": "^6.26.3", + "babel-loader": "^7.1.4", + "babel-minify-webpack-plugin": "^0.3.1", + "babel-preset-env": "^1.7.0", "backbone": "1.3.3", "backbone-virtual-collection": "^0.6.15", "backbone.marionette": "3.4.1", @@ -47,7 +47,8 @@ "prepack-webpack-plugin": "^1.1.0", "run-sequence": "^2.2.0", "underscore": "^1.8.3", - "webpack": "^3.8.1", + "webpack": "^4.12.0", + "webpack-cli": "^3.0.8", "webpack-stream": "^4.0.0", "webpack-visualizer-plugin": "^0.1.11" }, diff --git a/manager/webpack.config.js b/manager/webpack.config.js index 6e051fdd..794225f6 100644 --- a/manager/webpack.config.js +++ b/manager/webpack.config.js @@ -1,7 +1,33 @@ +const path = require('path'); const webpack = require('webpack'); const Visualizer = require('webpack-visualizer-plugin'); module.exports = { + entry: { + main: './src/frontend/js/main.js', + }, + output: { + path: path.resolve(__dirname, 'dist'), + filename: '[name].js', + publicPath: '/' + }, + + module: { + rules: [ + { + test: /\.js$/, + exclude: /node_modules/, + use: { + loader: 'babel-loader' + } + }, + { + test: /\.ejs$/, + loader: 'ejs-loader' + } + ] + }, +/* context: __dirname + '/src/frontend/js', entry: './main.js', output: { @@ -15,7 +41,7 @@ module.exports = { { test: /\.js$/, exclude: /(node_modules|bower_components)/, - loader: 'babel-loader', + loader: 'babel-loader'//, query: { presets: ['@babel/es2015'] } @@ -26,6 +52,22 @@ module.exports = { } ] }, +*/ + plugins: [ + new webpack.ProvidePlugin({ + $: 'jquery', + jQuery: 'jquery', + _: 'underscore' + }), + new Visualizer({ + filename: '../webpack_stats.html' + }), + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1, // Must be greater than or equal to one + minChunkSize: 999999999 + }) + ] +/* plugins: [ new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), new webpack.optimize.LimitChunkCountPlugin({ @@ -49,4 +91,5 @@ module.exports = { } }) ] +*/ }; From 353eeaa0aeff2ffb2837d745a3e6618a9e4e14f8 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Mon, 30 Jul 2018 12:06:23 +1000 Subject: [PATCH 3/6] Fix CI --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7f51ad60..6ca6cf06 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -60,7 +60,6 @@ pipeline { sh 'docker pull jc21/$IMAGE_NAME-base:armhf' sh 'docker run --rm -v $(pwd)/manager:/srv/manager -w /srv/manager jc21/$IMAGE_NAME-base:armhf yarn --registry=$NPM_REGISTRY install' sh 'docker run --rm -v $(pwd)/manager:/srv/manager -w /srv/manager jc21/$IMAGE_NAME-base:armhf gulp build' - sh 'docker run --rm -v $(pwd)/manager:/srv/manager -w /srv/manager jc21/$IMAGE_NAME-base:armhf rm -rf node_modules' sh 'docker run --rm -v $(pwd)/manager:/srv/manager -w /srv/manager jc21/$IMAGE_NAME-base:armhf yarn --registry=$NPM_REGISTRY install --prod' sh 'docker run --rm -v $(pwd)/manager:/data $DOCKER_CI_TOOLS:latest-armhf node-prune' @@ -84,6 +83,9 @@ pipeline { } sh 'docker rmi $TEMP_IMAGE_NAME_ARM' + + // Fix perms for the next build + sh 'sudo chown -R jenkins:jenkins * .git' } } } From 1382350d3a4ce346556d4bb19860c9adb2a2d94d Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Mon, 30 Jul 2018 12:33:26 +1000 Subject: [PATCH 4/6] Fix CI --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6ca6cf06..0d577175 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,7 +61,6 @@ pipeline { sh 'docker run --rm -v $(pwd)/manager:/srv/manager -w /srv/manager jc21/$IMAGE_NAME-base:armhf yarn --registry=$NPM_REGISTRY install' sh 'docker run --rm -v $(pwd)/manager:/srv/manager -w /srv/manager jc21/$IMAGE_NAME-base:armhf gulp build' sh 'docker run --rm -v $(pwd)/manager:/srv/manager -w /srv/manager jc21/$IMAGE_NAME-base:armhf yarn --registry=$NPM_REGISTRY install --prod' - sh 'docker run --rm -v $(pwd)/manager:/data $DOCKER_CI_TOOLS:latest-armhf node-prune' // Docker Build sh 'docker build --pull --no-cache --squash --compress -f Dockerfile.armhf -t $TEMP_IMAGE_NAME_ARM .' From 95d9e87f51b07896637c9af272b521c3db0ba833 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Mon, 30 Jul 2018 12:47:52 +1000 Subject: [PATCH 5/6] Update CI notifications --- Jenkinsfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0d577175..a10450d9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -92,11 +92,11 @@ pipeline { } post { success { - slackSend color: "#72c900", message: "SUCCESS: <${BUILD_URL}|${JOB_NAME}> build #${BUILD_NUMBER} - ${currentBuild.durationString}" + juxtapose event: success sh 'figlet "SUCCESS"' } failure { - slackSend color: "#d61111", message: "FAILED: <${BUILD_URL}|${JOB_NAME}> build #${BUILD_NUMBER} - ${currentBuild.durationString}" + juxtapose event: failure sh 'figlet "FAILURE"' } } @@ -106,3 +106,4 @@ def getPackageVersion() { ver = sh(script: 'docker run --rm -v $(pwd)/manager:/data $DOCKER_CI_TOOLS bash -c "cat /data/package.json|jq -r \'.version\'"', returnStdout: true) return ver.trim() } + From 5b45312f17bcc77ca87910c463284156c0065574 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Mon, 30 Jul 2018 13:52:41 +1000 Subject: [PATCH 6/6] Whoops, fix CI again --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a10450d9..90922b8d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -92,11 +92,11 @@ pipeline { } post { success { - juxtapose event: success + juxtapose event: 'success' sh 'figlet "SUCCESS"' } failure { - juxtapose event: failure + juxtapose event: 'failure' sh 'figlet "FAILURE"' } }