1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

feat(build-system): add support for AppVeyor CI (#2449)

This commit is contained in:
Steven Kang 2018-12-07 16:19:58 +13:00 committed by Anthony Lapenna
parent 2541f4daea
commit 65979709e9
12 changed files with 343 additions and 27 deletions

View file

@ -259,14 +259,24 @@ gruntfile_cfg.replace = {
};
function shell_buildBinary(p, a) {
var binfile = 'dist/portainer-' + p + '-' + a;
return [
'if [ -f ' + ((p === 'windows') ? binfile + '.exe' : binfile) + ' ]; then',
'echo "Portainer binary exists";',
'else',
'build/build_in_container.sh ' + p + ' ' + a + ';',
'fi'
].join(' ');
var binfile = 'portainer-'+p+'-'+a;
if (p === "linux") {
return [
'if [ -f '+(binfile)+' ]; then',
'echo "Portainer binary exists";',
'else',
'build/build_binary.sh ' + p + ' ' + a + ';',
'fi'
].join (' ')
} else {
return [
'powershell -Command "& {if (Get-Item -Path '+(binfile+'.exe')+' -ErrorAction:SilentlyContinue) {',
'Write-Host "Portainer binary exists"',
'} else {',
'& ".\\build\\build_binary.ps1" -platform '+ p +' -arch '+ a +'',
'}}"'
].join(' ')
}
}
function shell_run(arch) {
@ -281,14 +291,24 @@ function shell_downloadDockerBinary(p, a) {
var as = { 'amd64': 'x86_64', 'arm': 'armhf', 'arm64': 'aarch64' };
var ip = ((ps[p] === undefined) ? p : ps[p]);
var ia = ((as[a] === undefined) ? a : as[a]);
var binaryVersion = ((p === 'windows' ? '<%= shippedDockerVersionWindows %>' : '<%= shippedDockerVersion %>'));
return [
'if [ -f ' + ((p === 'windows') ? 'dist/docker.exe' : 'dist/docker') + ' ]; then',
'echo "Docker binary exists";',
'else',
'build/download_docker_binary.sh ' + ip + ' ' + ia + ' ' + binaryVersion + ';',
'fi'
].join(' ');
var binaryVersion = (( p === 'windows' ? '<%= shippedDockerVersionWindows %>' : '<%= shippedDockerVersion %>' ));
if (p === "linux") {
return [
'if [ -f '+('dist/docker')+' ]; then',
'echo "Docker binary exists";',
'else',
'build/download_docker_binary.sh ' + ip + ' ' + ia + ' ' + binaryVersion + ';',
'fi'
].join (' ')
} else {
return [
'powershell -Command "& {if (Get-Item -Path '+('dist/docker.exe')+' -ErrorAction:SilentlyContinue) {',
'Write-Host "Docker binary exists"',
'} else {',
'& ".\\build\\download_docker_binary.ps1" -docker_version '+ binaryVersion +'',
'}}"'
].join(' ')
}
}
gruntfile_cfg.shell = {