feat(build-system): update build system (#2682)

pull/2690/head
Anthony Lapenna 6 years ago committed by GitHub
parent 9b6b6e09ae
commit fdc11dbe3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -56,7 +56,7 @@ module.exports = function(grunt) {
});
grunt.registerTask('lint', ['eslint']);
grunt.registerTask('run-dev', ['build', 'shell:run:' + arch, 'watch:build']);
grunt.registerTask('run-dev', ['build', 'shell:run', 'watch:build']);
grunt.registerTask('clear', ['clean:app']);
// Load content of `vendor.yml` to src.jsVendor, src.cssVendor and src.angularVendor
@ -264,7 +264,7 @@ gruntfile_cfg.replace = {
};
function shell_buildBinary(p, a) {
var binfile = 'dist/portainer-' + p + '-' + a;
var binfile = 'dist/portainer';
if (p === 'linux') {
return [
'if [ -f ' + (binfile) + ' ]; then',
@ -292,10 +292,10 @@ function shell_buildBinaryOnDevOps(p, a) {
}
}
function shell_run(arch) {
function shell_run() {
return [
'docker rm -f portainer',
'docker run -d -p 9000:9000 -v $(pwd)/dist:/app -v /tmp/portainer:/data -v /var/run/docker.sock:/var/run/docker.sock:z --name portainer portainer/base /app/portainer-linux-' + arch + ' --no-analytics --template-file /app/templates.json'
'docker run -d -p 9000:9000 -v $(pwd)/dist:/app -v /tmp/portainer:/data -v /var/run/docker.sock:/var/run/docker.sock:z --name portainer portainer/base /app/portainer --no-analytics --template-file /app/templates.json'
].join(';');
}

@ -20,12 +20,11 @@
}
],
"scripts": {
"grunt": "grunt",
"start": "grunt run-dev",
"start:server": "yarn build:server:offline && grunt shell:run:amd64",
"start:server": "yarn build:server:offline && grunt shell:run",
"clean:all": "grunt clean:all",
"build": "grunt build",
"build:server:offline": "cd ./api/cmd/portainer && CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s' && mv -f portainer ../../../dist/portainer-linux-amd64"
"build:server:offline": "cd ./api/cmd/portainer && CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s' && mv -f portainer ../../../dist/portainer"
},
"engines": {
"node": ">= 0.8.4"

Loading…
Cancel
Save