feat(ci): add missing powershell scripts & fix related grunt code (#4345)

* feat(ci): add missing powershell scripts & fix related grunt code

* feat(ci): download binaries direct to dist directory

* feat(ci): correctly pass in binary versions

* feat(ci): fix powershell errors

* feat(ci): fix cmdlet syntax

* feat(ci): fix typo

* feat(ci): fix additonal typo
pull/4349/head
itsconquest 4 years ago committed by GitHub
parent d4c4c4e895
commit e479e41aee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,7 @@
param (
[string]$kompose_version
)
$ErrorActionPreference = "Stop";
Invoke-WebRequest -O "dist/kompose.exe" "https://github.com/kubernetes/kompose/releases/download/$($kompose_version)/kompose-windows-amd64.exe"

@ -0,0 +1,7 @@
param (
[string]$kubectl_version
)
$ErrorActionPreference = "Stop";
Invoke-WebRequest -O "dist/kubectl.exe" "https://storage.googleapis.com/kubernetes-release/release/$($kubectl_version)/bin/windows/amd64/kubectl.exe"

@ -194,8 +194,9 @@ function shell_download_docker_binary(p, a) {
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"',
'powershell -Command "& {if (Test-Path -Path "dist/docker.exe") {',
'Write-Host "Skipping download, Docker binary exists"',
'return',
'} else {',
'& ".\\build\\download_docker_binary.ps1" -docker_version ' + binaryVersion + '',
'}}"',
@ -210,10 +211,11 @@ function shell_download_kompose_binary(p, a) {
return ['if [ -f dist/kompose ]; then', 'echo "kompose binary exists";', 'else', 'build/download_kompose_binary.sh ' + p + ' ' + a + ' ' + binaryVersion + ';', 'fi'].join(' ');
} else {
return [
'powershell -Command "& {if (Get-Item -Path dist/kompose.exe -ErrorAction:SilentlyContinue) {',
'Write-Host "Docker binary exists"',
'powershell -Command "& {if (Test-Path -Path "dist/kompose.exe") {',
'Write-Host "Skipping download, Kompose binary exists"',
'return',
'} else {',
'& ".\\build\\download_kompose_binary.ps1" -docker_version ' + binaryVersion + '',
'& ".\\build\\download_kompose_binary.ps1" -kompose_version ' + binaryVersion + '',
'}}"',
].join(' ');
}
@ -226,10 +228,11 @@ function shell_download_kubectl_binary(p, a) {
return ['if [ -f dist/kubectl ]; then', 'echo "kubectl binary exists";', 'else', 'build/download_kubectl_binary.sh ' + p + ' ' + a + ' ' + binaryVersion + ';', 'fi'].join(' ');
} else {
return [
'powershell -Command "& {if (Get-Item -Path dist/kubectl.exe -ErrorAction:SilentlyContinue) {',
'Write-Host "Docker binary exists"',
'powershell -Command "& {if (Test-Path -Path "dist/kubectl.exe") {',
'Write-Host "Skipping download, Kubectl binary exists"',
'return',
'} else {',
'& ".\\build\\download_kubectl_binary.ps1" -docker_version ' + binaryVersion + '',
'& ".\\build\\download_kubectl_binary.ps1" -kubectl_version ' + binaryVersion + '',
'}}"',
].join(' ');
}

Loading…
Cancel
Save