Add Linux ARM support (#299)

Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
pull/313/head
Stefan Scherer 2016-10-31 21:07:32 +01:00 committed by Anthony Lapenna
parent 17f35ef705
commit c913d858ee
2 changed files with 32 additions and 0 deletions

View File

@ -19,4 +19,10 @@ mv dist/* /tmp/portainer-build-win/portainer
cd /tmp/portainer-build-win
tar cvpfz portainer-${VERSION}-windows-amd64.tar.gz portainer
grunt release-arm
rm -rf /tmp/portainer-build-arm && mkdir -pv /tmp/portainer-build-arm/portainer
mv dist/* /tmp/portainer-build-arm/portainer
cd /tmp/portainer-build-arm
tar cvpfz portainer-${VERSION}-linux-arm.tar.gz portainer
exit 0

View File

@ -47,6 +47,18 @@ module.exports = function (grunt) {
'recess:min',
'copy'
]);
grunt.registerTask('release-arm', [
'clean:all',
'if:unixArmBinaryNotExist',
'html2js',
'uglify',
'clean:tmpl',
'jshint',
//'karma:unit',
'concat:index',
'recess:min',
'copy'
]);
grunt.registerTask('lint', ['jshint']);
grunt.registerTask('test-watch', ['karma:watch']);
grunt.registerTask('run', ['if:unixBinaryNotExist', 'build', 'shell:buildImage', 'shell:run']);
@ -275,6 +287,14 @@ module.exports = function (grunt) {
'mv api/portainer dist/'
].join(' && ')
},
buildUnixArmBinary: {
command: [
'docker run --rm -v $(pwd)/api:/src -e BUILD_GOOS="linux" -e BUILD_GOARCH="arm" centurylink/golang-builder-cross',
'shasum api/portainer-linux-arm > portainer-checksum.txt',
'mkdir -p dist',
'mv api/portainer-linux-arm dist/portainer'
].join(' && ')
},
buildWindowsBinary: {
command: [
'docker run --rm -v $(pwd)/api:/src -e BUILD_GOOS="windows" -e BUILD_GOARCH="amd64" centurylink/golang-builder-cross',
@ -315,6 +335,12 @@ module.exports = function (grunt) {
},
ifFalse: ['shell:buildBinary']
},
unixArmBinaryNotExist: {
options: {
executable: 'dist/portainer'
},
ifFalse: ['shell:buildUnixArmBinary']
},
windowsBinaryNotExist: {
options: {
executable: 'dist/portainer.exe'