chore(docker): update docker binary version to 18.09.0 (#2510)

pull/2485/head
Anthony Lapenna 2018-12-03 12:10:55 +13:00 committed by GitHub
parent 969f70edeb
commit dc9a878f4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 46 additions and 45 deletions

View File

@ -2,9 +2,9 @@ var gruntfile_cfg = {};
var loadGruntTasks = require('load-grunt-tasks'); var loadGruntTasks = require('load-grunt-tasks');
var os = require('os'); var os = require('os');
var arch = os.arch(); var arch = os.arch();
if ( arch === 'x64' ) arch = 'amd64'; if (arch === 'x64') arch = 'amd64';
module.exports = function (grunt) { module.exports = function(grunt) {
loadGruntTasks(grunt, { loadGruntTasks(grunt, {
pattern: ['grunt-*', 'gruntify-*'] pattern: ['grunt-*', 'gruntify-*']
@ -48,46 +48,46 @@ module.exports = function (grunt) {
'after-copy' 'after-copy'
]); ]);
grunt.task.registerTask('release', 'release:<platform>:<arch>', function(p, a) { grunt.task.registerTask('release', 'release:<platform>:<arch>', function(p, a) {
grunt.task.run(['config:prod', 'clean:all', 'shell:buildBinary:'+p+':'+a, 'shell:downloadDockerBinary:'+p+':'+a, 'before-copy', 'copy:assets', 'after-copy' ]); grunt.task.run(['config:prod', 'clean:all', 'shell:buildBinary:' + p + ':' + a, 'shell:downloadDockerBinary:' + p + ':' + a, 'before-copy', 'copy:assets', 'after-copy']);
}); });
grunt.registerTask('lint', ['eslint']); grunt.registerTask('lint', ['eslint']);
grunt.registerTask('run-dev', ['build', 'shell:run:'+arch, 'watch:build']); grunt.registerTask('run-dev', ['build', 'shell:run:' + arch, 'watch:build']);
grunt.registerTask('clear', ['clean:app']); grunt.registerTask('clear', ['clean:app']);
// Load content of `vendor.yml` to src.jsVendor, src.cssVendor and src.angularVendor // Load content of `vendor.yml` to src.jsVendor, src.cssVendor and src.angularVendor
grunt.registerTask('vendor', function() { grunt.registerTask('vendor', function() {
var vendorFile = grunt.file.readYAML('vendor.yml'); var vendorFile = grunt.file.readYAML('vendor.yml');
for (var filelist in vendorFile) { for (var filelist in vendorFile) {
if (vendorFile.hasOwnProperty(filelist)) { if (vendorFile.hasOwnProperty(filelist)) {
var list = vendorFile[filelist]; var list = vendorFile[filelist];
// Check if any of the files is missing // Check if any of the files is missing
for (var itemIndex in list) { for (var itemIndex in list) {
if (list.hasOwnProperty(itemIndex)) { if (list.hasOwnProperty(itemIndex)) {
var item = 'node_modules/'+list[itemIndex]; var item = 'node_modules/' + list[itemIndex];
if (!grunt.file.exists(item)) { if (!grunt.file.exists(item)) {
grunt.fail.warn('Dependency file ' + item + ' not found.'); grunt.fail.warn('Dependency file ' + item + ' not found.');
} }
list[itemIndex] = item; list[itemIndex] = item;
}
}
// If none is missing, save the list
grunt.config('src.' + filelist + 'Vendor', list);
} }
}
// If none is missing, save the list
grunt.config('src.' + filelist + 'Vendor', list);
} }
}
}); });
// Project configuration. // Project configuration.
grunt.initConfig({ grunt.initConfig({
root: 'dist', root: 'dist',
distdir: 'dist/public', distdir: 'dist/public',
shippedDockerVersion: '18.06.1-ce', shippedDockerVersion: '18.09.0',
shippedDockerVersionWindows: '17.09.0-ce', shippedDockerVersionWindows: '17.09.0-ce',
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON('package.json'),
config: gruntfile_cfg.config, config: gruntfile_cfg.config,
src: gruntfile_cfg.src, src: gruntfile_cfg.src,
clean: gruntfile_cfg.clean, clean: gruntfile_cfg.clean,
useminPrepare: gruntfile_cfg.useminPrepare, useminPrepare: gruntfile_cfg.useminPrepare,
filerev: { files: { src: ['<%= distdir %>/js/*.js', '<%= distdir %>/css/*.css'] }}, filerev: { files: { src: ['<%= distdir %>/js/*.js', '<%= distdir %>/css/*.css'] } },
usemin: { html: ['<%= distdir %>/index.html'] }, usemin: { html: ['<%= distdir %>/index.html'] },
copy: gruntfile_cfg.copy, copy: gruntfile_cfg.copy,
eslint: gruntfile_cfg.eslint, eslint: gruntfile_cfg.eslint,
@ -108,8 +108,8 @@ var autoprefixer = require('autoprefixer');
var cssnano = require('cssnano'); var cssnano = require('cssnano');
gruntfile_cfg.config = { gruntfile_cfg.config = {
dev: { options: { variables: { 'environment': 'development' }}}, dev: { options: { variables: { 'environment': 'development' } } },
prod: { options: { variables: { 'environment': 'production' }}} prod: { options: { variables: { 'environment': 'production' } } }
}; };
gruntfile_cfg.src = { gruntfile_cfg.src = {
@ -152,18 +152,18 @@ gruntfile_cfg.useminPrepare = {
gruntfile_cfg.copy = { gruntfile_cfg.copy = {
bundle: { bundle: {
files: [ files: [
{dest:'<%= distdir %>/js/', src: ['app.js'], expand: true, cwd: '.tmp/concat/js/' }, { dest: '<%= distdir %>/js/', src: ['app.js'], expand: true, cwd: '.tmp/concat/js/' },
{dest:'<%= distdir %>/css/', src: ['app.css'], expand: true, cwd: '.tmp/concat/css/' } { dest: '<%= distdir %>/css/', src: ['app.css'], expand: true, cwd: '.tmp/concat/css/' }
] ]
}, },
assets: { assets: {
files: [ files: [
{dest: '<%= distdir %>/fonts/', src: '*.{ttf,woff,woff2,eof,svg}', expand: true, cwd: 'node_modules/bootstrap/fonts/'}, { dest: '<%= distdir %>/fonts/', src: '*.{ttf,woff,woff2,eof,svg}', expand: true, cwd: 'node_modules/bootstrap/fonts/' },
{dest: '<%= distdir %>/fonts/', src: '*.{ttf,woff,woff2,eof,eot,svg}', expand: true, cwd: 'node_modules/@fortawesome/fontawesome-free-webfonts/webfonts/'}, { dest: '<%= distdir %>/fonts/', src: '*.{ttf,woff,woff2,eof,eot,svg}', expand: true, cwd: 'node_modules/@fortawesome/fontawesome-free-webfonts/webfonts/' },
{dest: '<%= distdir %>/fonts/', src: '*.{ttf,woff,woff2,eof,svg}', expand: true, cwd: 'node_modules/rdash-ui/dist/fonts/'}, { dest: '<%= distdir %>/fonts/', src: '*.{ttf,woff,woff2,eof,svg}', expand: true, cwd: 'node_modules/rdash-ui/dist/fonts/' },
{dest: '<%= distdir %>/images/', src: '**', expand: true, cwd: 'assets/images/'}, { dest: '<%= distdir %>/images/', src: '**', expand: true, cwd: 'assets/images/' },
{dest: '<%= distdir %>/ico', src: '**', expand: true, cwd: 'assets/ico'}, { dest: '<%= distdir %>/ico', src: '**', expand: true, cwd: 'assets/ico' },
{dest: '<%= root %>/', src: 'templates.json', cwd: ''} { dest: '<%= root %>/', src: 'templates.json', cwd: '' }
] ]
} }
}; };
@ -205,8 +205,9 @@ gruntfile_cfg.uglify = {
}, },
vendor: { vendor: {
options: { preserveComments: 'some' }, // Preserve license comments options: { preserveComments: 'some' }, // Preserve license comments
files: { '<%= distdir %>/js/vendor.js': ['<%= src.jsVendor %>'] , files: {
'<%= distdir %>/js/angular.js': ['<%= src.angularVendor %>'] '<%= distdir %>/js/vendor.js': ['<%= src.jsVendor %>'],
'<%= distdir %>/js/angular.js': ['<%= src.angularVendor %>']
} }
} }
}; };
@ -215,7 +216,7 @@ gruntfile_cfg.postcss = {
build: { build: {
options: { options: {
processors: [ processors: [
autoprefixer({browsers: 'last 2 versions'}), // add vendor prefixes autoprefixer({ browsers: 'last 2 versions' }), // add vendor prefixes
cssnano() // minify the result cssnano() // minify the result
] ]
}, },
@ -235,9 +236,9 @@ gruntfile_cfg.replace = {
concat: { concat: {
options: { options: {
patterns: [ patterns: [
{ match: 'ENVIRONMENT', replacement: '<%= grunt.config.get("environment") %>' }, { match: 'ENVIRONMENT', replacement: '<%= grunt.config.get("environment") %>' },
{ match: 'CONFIG_GA_ID', replacement: '<%= pkg.config.GA_ID %>' }, { match: 'CONFIG_GA_ID', replacement: '<%= pkg.config.GA_ID %>' },
{ match: /..\/webfonts\//g, replacement: '../fonts/'} { match: /..\/webfonts\//g, replacement: '../fonts/' }
] ]
}, },
files: [ files: [
@ -258,12 +259,12 @@ gruntfile_cfg.replace = {
}; };
function shell_buildBinary(p, a) { function shell_buildBinary(p, a) {
var binfile = 'dist/portainer-'+p+'-'+a; var binfile = 'dist/portainer-' + p + '-' + a;
return [ return [
'if [ -f '+(( p === 'windows' ) ? binfile+'.exe' : binfile)+' ]; then', 'if [ -f ' + ((p === 'windows') ? binfile + '.exe' : binfile) + ' ]; then',
'echo "Portainer binary exists";', 'echo "Portainer binary exists";',
'else', 'else',
'build/build_in_container.sh ' + p + ' ' + a + ';', 'build/build_in_container.sh ' + p + ' ' + a + ';',
'fi' 'fi'
].join(' '); ].join(' ');
} }
@ -280,12 +281,12 @@ function shell_downloadDockerBinary(p, a) {
var as = { 'amd64': 'x86_64', 'arm': 'armhf', 'arm64': 'aarch64' }; var as = { 'amd64': 'x86_64', 'arm': 'armhf', 'arm64': 'aarch64' };
var ip = ((ps[p] === undefined) ? p : ps[p]); var ip = ((ps[p] === undefined) ? p : ps[p]);
var ia = ((as[a] === undefined) ? a : as[a]); var ia = ((as[a] === undefined) ? a : as[a]);
var binaryVersion = (( p === 'windows' ? '<%= shippedDockerVersionWindows %>' : '<%= shippedDockerVersion %>' )); var binaryVersion = ((p === 'windows' ? '<%= shippedDockerVersionWindows %>' : '<%= shippedDockerVersion %>'));
return [ return [
'if [ -f '+(( p === 'windows' ) ? 'dist/docker.exe' : 'dist/docker')+' ]; then', 'if [ -f ' + ((p === 'windows') ? 'dist/docker.exe' : 'dist/docker') + ' ]; then',
'echo "Docker binary exists";', 'echo "Docker binary exists";',
'else', 'else',
'build/download_docker_binary.sh ' + ip + ' ' + ia + ' ' + binaryVersion + ';', 'build/download_docker_binary.sh ' + ip + ' ' + ia + ' ' + binaryVersion + ';',
'fi' 'fi'
].join(' '); ].join(' ');
} }