From 7df13112d216b4d32c92ba288603a0cbcccd9cb7 Mon Sep 17 00:00:00 2001 From: Albert Domenech Date: Sun, 15 May 2016 13:21:29 +0200 Subject: [PATCH 1/2] Initial debian/ubuntu installer: - Used grunt-packager and grunt-electron-installer-debian - Added debian/ubuntu ai32 arch support - Added Redhat/Centos/Fedora rpm support - Added electron-packager to MacOSX custom task - Fixed OSX Linux build and better conditional legibility Signed-off-by: Albert Domenech --- Gruntfile.js | 135 +++++++++++++++++++++++++++++++++++++++++++-- package.json | 3 + util/kitematic.png | Bin 0 -> 7987 bytes 3 files changed, 134 insertions(+), 4 deletions(-) create mode 100644 util/kitematic.png diff --git a/Gruntfile.js b/Gruntfile.js index 7cd1864b..b80fd884 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,3 +1,4 @@ +var fs = require('fs'); var path = require('path'); var execFile = require('child_process').execFile; var packagejson = require('./package.json'); @@ -26,7 +27,16 @@ module.exports = function (grunt) { var OSX_OUT = './dist'; var OSX_OUT_X64 = OSX_OUT + '/' + OSX_APPNAME + '-darwin-x64'; var OSX_FILENAME = OSX_OUT_X64 + '/' + OSX_APPNAME + '.app'; + var IS_WINDOWS = process.platform === 'win32'; + var IS_LINUX = process.platform == 'linux'; + + var IS_I386 = process.arch == 'ia32'; + var IS_X64 = process.arch == 'x64'; + + var IS_DEB = fs.existsSync('/etc/lsb-release') || fs.existsSync('/etc/debian_version'); + var IS_RPM = fs.existsSync('/etc/redhat-release'); + grunt.initConfig({ IDENTITY: 'Developer ID Application: Docker Inc', OSX_FILENAME: OSX_FILENAME, @@ -209,6 +219,9 @@ module.exports = function (grunt) { }, zip: { command: 'ditto -c -k --sequesterRsrc --keepParent <%= OSX_FILENAME_ESCAPED %> release/' + BASENAME + '-Mac.zip', + }, + linux_npm: { + command: 'cd build && npm install --production' } }, @@ -219,7 +232,7 @@ module.exports = function (grunt) { compress: { windows: { options: { - archive: './release/' + BASENAME + '-Windows.zip', + archive: './release/' + BASENAME + '-Windows.zip', mode: 'zip' }, files: [{ @@ -228,7 +241,7 @@ module.exports = function (grunt) { cwd: './dist/Kitematic-win32-x64', src: '**/*' }] - }, + }, }, // livereload @@ -252,12 +265,126 @@ module.exports = function (grunt) { files: ['images/*', 'index.html', 'fonts/*'], tasks: ['newer:copy:dev'] } + }, + 'electron-packager': { + build: { + options: { + platform: process.platform, + arch: process.arch, + dir: './build', + out: './dist/', + name: 'Kitematic', + ignore: 'bower.json', + version: packagejson['electron-version'], // set version of electron + overwrite: true + } + }, + osxlnx: { + options: { + platform: 'linux', + arch: 'x64', + dir: './build', + out: './dist/', + name: 'Kitematic', + ignore: 'bower.json', + version: packagejson['electron-version'], // set version of electron + overwrite: true + } + } + }, + 'electron-installer-debian': { + options: { + productName: LINUX_APPNAME, + productDescription: 'Run containers through a simple, yet powerful graphical user interface.', + section: 'devel', + priority: 'optional', + icon: './util/kitematic.png', + lintianOverrides: [ + 'changelog-file-missing-in-native-package', + 'executable-not-elf-or-script', + 'extra-license-file' + ], + categories: [ + 'Utility' + ], + rename: function (dest, src) { + return dest + '<%= name %>_'+ packagejson.version +'-<%= revision %>_<%= arch %>.deb'; + } + }, + linux64: { + options: { + arch: 'amd64' + }, + src: './dist/Kitematic-linux-x64/', + dest: './dist/', + }, + linux32: { + options: { + arch: 'i386' + }, + src: './dist/Kitematic-linux-ia32/', + dest: './dist/', + } + }, + 'electron-installer-redhat': { + options: { + productName: LINUX_APPNAME, + productDescription: 'Run containers through a simple, yet powerful graphical user interface.', + priority: 'optional', + icon: './util/kitematic.png', + categories: [ + 'Utilities' + ], + rename: function (dest, src) { + return dest + '<%= name %>_'+ packagejson.version +'-<%= revision %>_<%= arch %>.rpm'; + } + }, + linux64: { + options: { + arch: 'x86_64' + }, + src: './dist/Kitematic-linux-x64/', + dest: './dist/' + }, + linux32: { + options: { + arch: 'x86' + }, + src: './dist/Kitematic-linux-ia32/', + dest: './dist/' + } } }); + // Load the plugins for linux packaging + grunt.loadNpmTasks('grunt-electron-packager'); + grunt.loadNpmTasks('grunt-electron-installer-debian'); + grunt.loadNpmTasks('grunt-electron-installer-redhat'); + grunt.registerTask('default', ['newer:babel', 'less', 'newer:copy:dev', 'shell:electron', 'watchChokidar']); - if (!IS_WINDOWS) { - grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron', 'copy:osx', 'shell:sign', 'shell:zip', 'copy:windows', 'rcedit:exes', 'compress']); + + if (!IS_WINDOWS && !IS_LINUX) { + grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron', 'copy:osx', 'shell:sign', 'shell:zip', 'copy:windows', 'rcedit:exes', 'compress', 'shell:linux_npm', 'electron-packager:osxlnx', 'electron-installer-debian:linux64']); + }else if(IS_LINUX){ + + var linuxpackage = null; + // linux package detection + if(IS_DEB && IS_X64){ + linuxpackage = 'electron-installer-debian:linux64'; + }else if(IS_DEB && IS_I386){ + linuxpackage = 'electron-installer-debian:linux32'; + }else if(IS_RPM && IS_X64){ + linuxpackage = 'electron-installer-redhat:linux64'; + }else if(IS_RPM && IS_I386){ + linuxpackage = 'electron-installer-redhat:linux32'; + } + + if(linuxpackage){ + grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'shell:linux_npm', 'electron-packager:build', linuxpackage]); + }else{ + grunt.log.errorlns('Your Linux distribution is not yet supported - arch:'+ process.arch + ' platform:' + process.platform); + } + }else { grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron:windows', 'copy:windows', 'rcedit:exes', 'compress']); } diff --git a/package.json b/package.json index f5420459..bb98122a 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,9 @@ "grunt-download-electron": "^2.1.1", "grunt-electron": "^2.0.0", "grunt-electron-installer": "^1.0.4", + "grunt-electron-installer-debian": "^0.3.0", + "grunt-electron-installer-redhat": "^0.3.0", + "grunt-electron-packager": "0.0.7", "grunt-if-missing": "^1.0.0", "grunt-newer": "^1.1.1", "grunt-plistbuddy": "^0.1.1", diff --git a/util/kitematic.png b/util/kitematic.png new file mode 100644 index 0000000000000000000000000000000000000000..75ae25e8802b479c485d6e36e675dcab0aa6ab5c GIT binary patch literal 7987 zcmY*;bzIZm_y23efJsZ|C_y9zCLqW_QW2041%%NmNGgmTCEW^03y8FIsK^jTmnb0} z0@4kmw%_*t{PX=i_Soa~y61K8x#vDlKJJM!(9@!Ua6kY6pwZD*Hv|9>;S~f>f(Z`` zk75VHgUnI&fhqu0CtSI(CMS%+HutsE0X*@S*YYWaK%sKee&PuLSFRHOARr@)jXIx$vv6!%MGA4F@8v{VFG%im#V3* zVG!ANrCO#r60YvIs5|Ci;gnoIQoGs1F~0uZZseDa?30&_U$-W*pM8@7<=b6X z9GTuBcT*M4U;K7Dil09%KRQJ5wSr@A%gM8O35zGZ!k(PDhxd)Gxnmg zyTY|r1$*KB(!W1?%isNU)2PJRl7q)%&ohEksNZ5+zQ(|M^@>}#S^t|n)!3e>4Ui4M zdG{stG%bP)E-nlCFvgN6F9eQYnh=osjHz}p`dsJQSCRJWA)pyj zI=x$FWE!p6$o5XZWL>Q|`}u{%>D&|>N7piRl{H7#?G4lhI*5`2s#HPrp6coiPkyeN zOw(kl{HnUbe-9*2cdJsxqgi#u6Vme3nDySZjl1>bb<|$Tu!n9fHQ^%6q|AS=C4LgS zr|)W}=*dftKz$tI+4XzaXpCvrLa4mF`Nu3yU_!(Wof6GJw&Y9S6)w)~$GkG0zc=(E z$*L9C&=*q5gxbheezJP+keu|up3Sp@jRGbHI@~VI$Dq;3_rYfG0x&;tf`%un=B}9; zpCO?1lUi=MluWa2mh|)3wD$$>)N%K?*b2|;&;xKT!rCp92`yj6_|GrCu4a6XW=3V^ zzOedG^Me#-As}X)Cwr-BJCuKgR=Ox_{i@om z)*p_?#glUGOqYLBnPrZP%z!(szV)8v4n3``U6*f~W{o+SKvh**-KT0J*eB1Ja(+() zeyVqEPY84$f9k$YhWIHHacA*%3XgP7qgs2F#UV6|T3jlQbWdqQ%7U}w@}%XP|8Zss z11fWj=Lug9KD}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Mf*Q%Eai^! zw+3FmOe4Q~_DpB}6X!T@^EC88A$(S%^omf*(FaJJTCo{~MCSoICViiThv8WXTX8om zSjqmOukWvs_vefU#ZjAZlja4}PnAq@F4Cg8hNIyIw-08XM!?>5N^1lQ3QurTu*oaV zfyv?h3=Dr9G;&SdZ#m<1+bged|9k+Fr-;eDJuPCr;?b294(Vt8#|+7)(FkQrxpAZ7 z`jyZ)P?^0u)b97?r1`Ft+bTypK6|JRW- zH5cC%gS*8J8LnB6oTeQ*CJTo-p^B`c15(czBfF@BEjC##Kk$huLMLh8&5-<|)>15w qn|#X2TWfRM%HqzsF-PVJ9u(T_aPq0xo)8`ZKu1GQy;2Pk^8Wy2V%8Y| literal 0 HcmV?d00001 From 739e9ef43b6723ec53e43cca72f8417fcb02ca18 Mon Sep 17 00:00:00 2001 From: French Ben Date: Thu, 26 May 2016 17:06:20 -0700 Subject: [PATCH 2/2] Added Circle Changes Signed-off-by: French Ben --- Gruntfile.js | 96 ++++++++++++++++++++++++++++------------------------ circle.yml | 1 + package.json | 1 + 3 files changed, 53 insertions(+), 45 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index b80fd884..5905f45f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -27,20 +27,37 @@ module.exports = function (grunt) { var OSX_OUT = './dist'; var OSX_OUT_X64 = OSX_OUT + '/' + OSX_APPNAME + '-darwin-x64'; var OSX_FILENAME = OSX_OUT_X64 + '/' + OSX_APPNAME + '.app'; + var LINUX_FILENAME = OSX_OUT + '/' + BASENAME + '_' + packagejson.version + '_amd64.deb'; var IS_WINDOWS = process.platform === 'win32'; - var IS_LINUX = process.platform == 'linux'; + var IS_LINUX = process.platform === 'linux'; - var IS_I386 = process.arch == 'ia32'; - var IS_X64 = process.arch == 'x64'; + var IS_I386 = process.arch === 'ia32'; + var IS_X64 = process.arch === 'x64'; var IS_DEB = fs.existsSync('/etc/lsb-release') || fs.existsSync('/etc/debian_version'); var IS_RPM = fs.existsSync('/etc/redhat-release'); + var linuxpackage = null; + // linux package detection + if (IS_DEB && IS_X64) { + linuxpackage = 'electron-installer-debian:linux64'; + } else if (IS_DEB && IS_I386) { + linuxpackage = 'electron-installer-debian:linux32'; + LINUX_FILENAME = OSX_OUT + '/' + BASENAME + '_' + packagejson.version + '_i386.deb'; + } else if (IS_RPM && IS_X64) { + linuxpackage = 'electron-installer-redhat:linux64'; + LINUX_FILENAME = OSX_OUT + '/' + BASENAME + '_' + packagejson.version + '_x86_64.rpm'; + } else if (IS_RPM && IS_I386) { + linuxpackage = 'electron-installer-redhat:linux32'; + LINUX_FILENAME = OSX_OUT + '/' + BASENAME + '_' + packagejson.version + '_x86.rpm'; + } + grunt.initConfig({ IDENTITY: 'Developer ID Application: Docker Inc', OSX_FILENAME: OSX_FILENAME, - OSX_FILENAME_ESCAPED: OSX_FILENAME.replace(/ /g, '\\ ').replace(/\(/g,'\\(').replace(/\)/g,'\\)'), + OSX_FILENAME_ESCAPED: OSX_FILENAME.replace(/ /g, '\\ ').replace(/\(/g, '\\(').replace(/\)/g, '\\)'), + LINUX_FILENAME: LINUX_FILENAME, // electron electron: { @@ -191,7 +208,7 @@ module.exports = function (grunt) { expand: true, cwd: 'src/', src: ['**/*.js'], - dest: 'build/', + dest: 'build/' }] } }, @@ -208,31 +225,34 @@ module.exports = function (grunt) { }, sign: { options: { - failOnError: false, + failOnError: false }, command: [ 'codesign --deep -v -f -s "<%= IDENTITY %>" <%= OSX_FILENAME_ESCAPED %>/Contents/Frameworks/*', 'codesign -v -f -s "<%= IDENTITY %>" <%= OSX_FILENAME_ESCAPED %>', 'codesign -vvv --display <%= OSX_FILENAME_ESCAPED %>', 'codesign -v --verify <%= OSX_FILENAME_ESCAPED %>' - ].join(' && '), + ].join(' && ') }, zip: { - command: 'ditto -c -k --sequesterRsrc --keepParent <%= OSX_FILENAME_ESCAPED %> release/' + BASENAME + '-Mac.zip', + command: 'ditto -c -k --sequesterRsrc --keepParent <%= OSX_FILENAME_ESCAPED %> release/' + BASENAME + '-Mac.zip' }, linux_npm: { command: 'cd build && npm install --production' + }, + linux_zip: { + command: 'ditto -c -k --sequesterRsrc --keepParent <%= LINUX_FILENAME %> release/' + BASENAME + '-Ubuntu.deb' } }, clean: { - release: ['build/', 'dist/'], + release: ['build/', 'dist/'] }, compress: { windows: { options: { - archive: './release/' + BASENAME + '-Windows.zip', + archive: './release/' + BASENAME + '-Windows.zip', mode: 'zip' }, files: [{ @@ -241,7 +261,7 @@ module.exports = function (grunt) { cwd: './dist/Kitematic-win32-x64', src: '**/*' }] - }, + } }, // livereload @@ -280,15 +300,15 @@ module.exports = function (grunt) { } }, osxlnx: { - options: { - platform: 'linux', - arch: 'x64', - dir: './build', - out: './dist/', - name: 'Kitematic', - ignore: 'bower.json', - version: packagejson['electron-version'], // set version of electron - overwrite: true + options: { + platform: 'linux', + arch: 'x64', + dir: './build', + out: './dist/', + name: 'Kitematic', + ignore: 'bower.json', + version: packagejson['electron-version'], // set version of electron + overwrite: true } } }, @@ -308,7 +328,7 @@ module.exports = function (grunt) { 'Utility' ], rename: function (dest, src) { - return dest + '<%= name %>_'+ packagejson.version +'-<%= revision %>_<%= arch %>.deb'; + return LINUX_FILENAME; } }, linux64: { @@ -316,27 +336,27 @@ module.exports = function (grunt) { arch: 'amd64' }, src: './dist/Kitematic-linux-x64/', - dest: './dist/', + dest: './dist/' }, linux32: { options: { arch: 'i386' }, src: './dist/Kitematic-linux-ia32/', - dest: './dist/', - } + dest: './dist/' + } }, 'electron-installer-redhat': { options: { productName: LINUX_APPNAME, productDescription: 'Run containers through a simple, yet powerful graphical user interface.', priority: 'optional', - icon: './util/kitematic.png', + icon: './util/kitematic.png', categories: [ 'Utilities' ], rename: function (dest, src) { - return dest + '<%= name %>_'+ packagejson.version +'-<%= revision %>_<%= arch %>.rpm'; + return LINUX_FILENAME; } }, linux64: { @@ -364,27 +384,13 @@ module.exports = function (grunt) { grunt.registerTask('default', ['newer:babel', 'less', 'newer:copy:dev', 'shell:electron', 'watchChokidar']); if (!IS_WINDOWS && !IS_LINUX) { - grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron', 'copy:osx', 'shell:sign', 'shell:zip', 'copy:windows', 'rcedit:exes', 'compress', 'shell:linux_npm', 'electron-packager:osxlnx', 'electron-installer-debian:linux64']); - }else if(IS_LINUX){ - - var linuxpackage = null; - // linux package detection - if(IS_DEB && IS_X64){ - linuxpackage = 'electron-installer-debian:linux64'; - }else if(IS_DEB && IS_I386){ - linuxpackage = 'electron-installer-debian:linux32'; - }else if(IS_RPM && IS_X64){ - linuxpackage = 'electron-installer-redhat:linux64'; - }else if(IS_RPM && IS_I386){ - linuxpackage = 'electron-installer-redhat:linux32'; - } - - if(linuxpackage){ + grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron', 'copy:osx', 'shell:sign', 'shell:zip', 'copy:windows', 'rcedit:exes', 'shell:linux_npm', 'electron-packager:osxlnx', 'electron-installer-debian:linux64', 'shell:linux_zip']); + }else if (IS_LINUX) { + if (linuxpackage) { grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'shell:linux_npm', 'electron-packager:build', linuxpackage]); - }else{ - grunt.log.errorlns('Your Linux distribution is not yet supported - arch:'+ process.arch + ' platform:' + process.platform); + }else { + grunt.log.errorlns('Your Linux distribution is not yet supported - arch:' + process.arch + ' platform:' + process.platform); } - }else { grunt.registerTask('release', ['clean:release', 'babel', 'less', 'copy:dev', 'electron:windows', 'copy:windows', 'rcedit:exes', 'compress']); } diff --git a/circle.yml b/circle.yml index 59f1a786..145ce019 100644 --- a/circle.yml +++ b/circle.yml @@ -13,3 +13,4 @@ deployment: commands: - github-release upload --user docker --repo kitematic --tag $CIRCLE_TAG --file release/Kitematic-Mac.zip --name Kitematic-$(echo $CIRCLE_TAG | cut -c2-)-Mac.zip - github-release upload --user docker --repo kitematic --tag $CIRCLE_TAG --file release/Kitematic-Windows.zip --name Kitematic-$(echo $CIRCLE_TAG | cut -c2-)-Windows.zip + - github-release upload --user docker --repo kitematic --tag $CIRCLE_TAG --file release/Kitematic-Ubuntu.deb --name Kitematic-$(echo $CIRCLE_TAG | cut -c2-)-Ubuntu.deb diff --git a/package.json b/package.json index bb98122a..2328e933 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "test": "jest -c jest-unit.json", "integration": "jest -c jest-integration.json", "release": "grunt release", + "release-verbose": "grunt --verbose release", "lint": "jsxhint src" }, "license": "Apache-2.0",