diff --git a/.drone.yml b/.drone.yml index 32c35635..83f16a6b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,7 +20,7 @@ steps: - name: stage-binaries image: rancher/dapper:v0.5.4 commands: - - "Get-ChildItem -Path ./bin; Copy-Item -Force -Path ./bin/wins.exe -Destination ./package/windows/; Get-ChildItem -Path ./package/windows" + - "Get-ChildItem -Path ./bin; Get-ChildItem -Path ./dist; Copy-Item -Force -Path ./bin/wins.exe -Destination ./package/windows/; Get-ChildItem -Path ./package/windows" - name: github_binary_release image: plugins/github-release @@ -31,7 +31,7 @@ steps: - sha256 files: - bin/wins.exe - - charts/* + - dist/rancher-wins-upgrader-*.tgz when: instance: - drone-publish.rancher.io @@ -115,7 +115,7 @@ steps: - name: stage-binaries image: rancher/dapper:v0.5.4 commands: - - "Get-ChildItem -Path ./bin; Copy-Item -Force -Path ./bin/wins.exe -Destination ./package/windows/; Get-ChildItem -Path ./package/windows" + - "Get-ChildItem -Path ./bin; Get-ChildItem -Path ./dist; Copy-Item -Force -Path ./bin/wins.exe -Destination ./package/windows/; Get-ChildItem -Path ./package/windows" - name: docker-publish image: plugins/docker @@ -191,7 +191,7 @@ steps: - name: stage-binaries image: rancher/dapper:v0.5.4 commands: - - "Get-ChildItem -Path ./bin; Copy-Item -Force -Path ./bin/wins.exe -Destination ./package/windows/; Get-ChildItem -Path ./package/windows" + - "Get-ChildItem -Path ./bin; Get-ChildItem -Path ./dist; Copy-Item -Force -Path ./bin/wins.exe -Destination ./package/windows/; Get-ChildItem -Path ./package/windows" - name: docker-publish image: plugins/docker @@ -273,7 +273,7 @@ steps: - name: stage-binaries image: rancher/dapper:v0.5.4 commands: - - "Get-ChildItem -Path ./bin; Copy-Item -Force -Path ./bin/wins.exe -Destination ./package/windows/; Get-ChildItem -Path ./package/windows" + - "Get-ChildItem -Path ./bin; Get-ChildItem -Path ./dist; Copy-Item -Force -Path ./bin/wins.exe -Destination ./package/windows/; Get-ChildItem -Path ./package/windows" - name: docker-publish image: luthermonson/drone-docker:2004 @@ -356,7 +356,7 @@ steps: - name: stage-binaries image: rancher/dapper:v0.5.4 commands: - - "Get-ChildItem -Path ./bin; Copy-Item -Force -Path ./bin/wins.exe -Destination ./package/windows/; Get-ChildItem -Path ./package/windows" + - "Get-ChildItem -Path ./bin; Get-ChildItem -Path ./dist; Copy-Item -Force -Path ./bin/wins.exe -Destination ./package/windows/; Get-ChildItem -Path ./package/windows" - name: docker-publish image: luthermonson/drone-docker:20H2 diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 05ca6d94..aa4503b2 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -89,9 +89,28 @@ RUN pushd c:\; \ \ popd; +RUN pushd c:\; \ + $URL = 'https://get.helm.sh/helm-v3.5.3-windows-amd64.zip'; \ + \ + Write-Host ('Downloading helm from {0} ...' -f $URL); \ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ + Invoke-WebRequest -UseBasicParsing -OutFile c:\helm.zip -Uri $URL; \ + \ + Write-Host 'Expanding ...'; \ + Expand-Archive -Path c:\helm.zip -DestinationPath c:\; \ + \ + Write-Host 'Cleaning ...'; \ + Remove-Item -Force -Recurse -Path c:\helm.zip; \ + \ + Write-Host 'Updating PATH ...'; \ + [Environment]::SetEnvironmentVariable('PATH', ('c:\helm-v3.5.3-windows-amd64\;{0}' -f $env:PATH), [EnvironmentVariableTarget]::Machine); \ + \ + Write-Host 'Complete.'; \ + popd; + ENV DAPPER_ENV REPO TAG DRONE_TAG ENV DAPPER_SOURCE /gopath/src/github.com/rancher/wins -ENV DAPPER_OUTPUT ./bin +ENV DAPPER_OUTPUT ./bin ./dist ENV DAPPER_DOCKER_SOCKET true ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache ENV HOME ${DAPPER_SOURCE} diff --git a/scripts/ci.ps1 b/scripts/ci.ps1 index 5636eb26..62e6b42b 100644 --- a/scripts/ci.ps1 +++ b/scripts/ci.ps1 @@ -4,6 +4,7 @@ $ErrorActionPreference = 'Stop' Import-Module -WarningAction Ignore -Name "$PSScriptRoot\utils.psm1" +Invoke-Script -File "$PSScriptRoot\package-helm.ps1" Invoke-Script -File "$PSScriptRoot\test.ps1" Invoke-Script -File "$PSScriptRoot\build.ps1" Invoke-Script -File "$PSScriptRoot\package.ps1" diff --git a/scripts/package-helm.ps1 b/scripts/package-helm.ps1 new file mode 100644 index 00000000..7837bb0b --- /dev/null +++ b/scripts/package-helm.ps1 @@ -0,0 +1,12 @@ +#Requires -Version 5.0 +$ErrorActionPreference = "Stop" + +$SRC_PATH = (Resolve-Path "$PSScriptRoot\..").Path +Push-Location $SRC_PATH + +Remove-Item -Path "$SRC_PATH\dist\*" -Force -ErrorAction Ignore +$null = New-Item -Type Directory -Path dist -ErrorAction Ignore + +c:\windows-amd64\helm.exe package -d dist charts\rancher-wins-upgrader + +Pop-Location