From d1e99092023869f2bc609159d51f6c43ccbc8e2a Mon Sep 17 00:00:00 2001 From: Stefan Scherer Date: Mon, 21 Jan 2019 07:20:27 +0100 Subject: [PATCH 1/3] Deprecate docker package --- docker.nuspec | 13 +++++----- tools/chocolateyInstall.ps1 | 17 +------------ tools/docker/docker-proxy.exe.ignore | 0 tools/docker/dockerd.exe.ignore | 0 update.sh | 38 ---------------------------- 5 files changed, 8 insertions(+), 60 deletions(-) delete mode 100644 tools/docker/docker-proxy.exe.ignore delete mode 100644 tools/docker/dockerd.exe.ignore delete mode 100755 update.sh diff --git a/docker.nuspec b/docker.nuspec index 089ca3a..29fc2a5 100644 --- a/docker.nuspec +++ b/docker.nuspec @@ -4,14 +4,12 @@ docker - Docker CLI - 18.09.0 + [Deprecated] Docker CLI + 99.0.0 Docker Contributors ahmetalpbalkan - Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. - Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. This package contains the docker client for Windows and not the Docker engine to run containers on Windows hosts. - -NOTE: Docker client for Windows is not a Docker container engine for Windows. You can use this to manage your Linux and Windows machines running as Docker hosts. You might want to have a look at the "docker-for-windows" package. + This package is replaced by `docker-cli` to make it more obvious what's getting installed. + This package is replaced by `docker-cli` to make it more obvious what's getting installed. https://www.docker.com https://github.com/docker/cli docker devops containers @@ -24,6 +22,9 @@ NOTE: Docker client for Windows is not a Docker container engine for Windows. Yo https://raw.githubusercontent.com/ahmetb/docker-chocolatey/4be06de6bf48c35ddfc871bcf508a2d8308167d4/docker.png https://github.com/ahmetb/docker-chocolatey Updated to the latest Docker version. + + + diff --git a/tools/chocolateyInstall.ps1 b/tools/chocolateyInstall.ps1 index 2a69d84..34d53db 100644 --- a/tools/chocolateyInstall.ps1 +++ b/tools/chocolateyInstall.ps1 @@ -1,16 +1 @@ -$packageName = 'docker' -$url = 'https://github.com/StefanScherer/docker-cli-builder/releases/download/18.09.0/docker.exe' -$checksum = '831d191ecb337889287630d4b89a24953f1416deb76f823f42f7101de23ce540' -$url64 = $url -$checksum64 = $checksum -$checksumType = 'sha256' -$checksumType64 = 'sha256' -$validExitCodes = @(0) - -$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" - -$file = "$($toolsDir)\docker.exe" - -if (![System.IO.Directory]::Exists($toolsDir)) {[System.IO.Directory]::CreateDirectory($toolsDir)} - -Get-ChocolateyWebFile $packageName $file $url $url64 $checksum $checksum64 $checksumType $checksumType64 +Write-Warning 'This package is superseeded by docker-cli, you should install that package from now on.' diff --git a/tools/docker/docker-proxy.exe.ignore b/tools/docker/docker-proxy.exe.ignore deleted file mode 100644 index e69de29..0000000 diff --git a/tools/docker/dockerd.exe.ignore b/tools/docker/dockerd.exe.ignore deleted file mode 100644 index e69de29..0000000 diff --git a/update.sh b/update.sh deleted file mode 100755 index 6524719..0000000 --- a/update.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -if [ "$1" = "" ]; then - echo "Usage: $0 version" - echo "Update the choco package to a given version" - echo "Example: $0 18.08.0" - exit 1 -fi - -if [[ "${OSTYPE}" != "darwin"* && "${OSTYPE}" != "linux-gnu"* ]]; then - echo "This version support Mac and Windows Subsystem for Linux" - exit 2 -fi - -version=$1 - -uri="edge" - -if [[ $version = *"-rc"* ]] -then - uri="test" -fi -set -e - -url="https://github.com/StefanScherer/docker-cli-builder/releases/download/${version}/docker.exe" -checksum=$(curl --fail -L "${url}" | shasum -a 256 | cut -f 1 -d " ") - -# cut off "-ce", eg. 17.06.0-ce -> 17.06.0 -version=${version//-ce/} - -sed -i.bak "s/.*<\/version>/${version}<\/version>/" docker.nuspec - -sed -i.bak "s/version: .*{build}/version: ${version}.{build}/" appveyor.yml - -sed -i.bak "s!^\$url = '.*'!\$url = '${url}'!" tools/chocolateyInstall.ps1 -sed -i.bak "s/^\$checksum = '.*'/\$checksum = '${checksum}'/" tools/chocolateyInstall.ps1 -sed -i.bak "s!^\$url64 = '.*'!\$url64 = '${url64}'!" tools/chocolateyInstall.ps1 -sed -i.bak "s/^\$checksum64 = '.*'/\$checksum64 = '${checksum64}'/" tools/chocolateyInstall.ps1 From 8c92a4b6035e889b1954df4d2935ba5d85710ab9 Mon Sep 17 00:00:00 2001 From: Stefan Scherer Date: Mon, 21 Jan 2019 07:41:34 +0100 Subject: [PATCH 2/3] Update tests --- appveyor.yml | 2 +- test.ps1 | 16 ++++++++++++---- test.sh | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 689937f..981f572 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 18.09.0.{build} +version: 99.0.0.{build} environment: TOKEN: secure: TihxnYdIwtxnhS568XO7PECa6ETPBcTk2fUSgO8wq60c75Io9xPXE3TtLCBf5D6h diff --git a/test.ps1 b/test.ps1 index 4240dcb..1f03d14 100644 --- a/test.ps1 +++ b/test.ps1 @@ -18,17 +18,25 @@ if ($spec.package.metadata.version.CompareTo($version)) { "TEST: Package should contain only install script" Add-Type -assembly "system.io.compression.filesystem" $zip = [IO.Compression.ZipFile]::OpenRead("$pwd\docker.$version.nupkg") -if ($zip.Entries.Count -ne 7) { +if ($zip.Entries.Count -ne 5) { Write-Error "FAIL: Wrong count in nupkg!" } $zip.Dispose() +try { + . choco install -y docker -source . + Write-Error "FAIL: docker package could be installed" +} catch { + Write-Host "PASS: docker could not be installed as the dependency could not be found" +} + "TEST: Installation of package should work" +. choco install -y docker-cli -version 18.09.0 . choco install -y docker -source . "TEST: Version of binary should match" . docker --version -if (-Not $(docker --version).Contains("version $version,")) { +if (-Not $(docker --version).Contains("version 18.09.0,")) { Write-Error "FAIL: Wrong version of docker installed!" } @@ -46,9 +54,9 @@ if (Test-Path $env:ChocolateyInstall\bin\docker-proxy.exe) { . choco uninstall docker try { . docker - Write-Error "FAIL: docker binary still found" + Write-Host "PASS: docker still found" } catch { - Write-Host "PASS: docker not found" + Write-Error "FAIL: docker binary not found" } "TEST: Finished" diff --git a/test.sh b/test.sh index f097797..915a21e 100755 --- a/test.sh +++ b/test.sh @@ -2,7 +2,7 @@ # Build and test the docker NuGet package in a Windows container docker build -t chocolatey - < Date: Mon, 21 Jan 2019 07:44:59 +0100 Subject: [PATCH 3/3] Simplify uninstall test --- test.ps1 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/test.ps1 b/test.ps1 index 1f03d14..e204f03 100644 --- a/test.ps1 +++ b/test.ps1 @@ -50,13 +50,7 @@ if (Test-Path $env:ChocolateyInstall\bin\docker-proxy.exe) { Write-Error "FAIL: Docker proxy shim exists!" } -"TEST: Uninstall show remove the binary" +"TEST: Uninstall should work" . choco uninstall docker -try { - . docker - Write-Host "PASS: docker still found" -} catch { - Write-Error "FAIL: docker binary not found" -} "TEST: Finished"