Skip to content

Commit

Permalink
Merge pull request #10 from StefanScherer/update-docker-1.11.0
Browse files Browse the repository at this point in the history
Update Docker 1.11.0
  • Loading branch information
StefanScherer committed Apr 15, 2016
2 parents 7b9ee1e + dd0752e commit b347e95
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 81 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**.nupkg
*.bak
91 changes: 22 additions & 69 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,85 +14,40 @@ Main installation script is written in PowerShell and is in

## Setting up development environment.

1. Install Chocolatey (http://chocolatey.org) on your
Windows machine.
2. Install `nuget` package: `choco install nuget`.
3. Clone this repository.
1. Clone this repository.

## Making a new release

#### 1. Update `docker.nuspec`
#### 1. Update all files

You need to update the value in `<version>` tag with
the official docker version string correctly.
Run `./update.sh 1.10.3` and specifiy the new version of the Docker client. (The script works on Mac only at the moment).
This will update these files
* docker.nuspec
* appveyor.yml
* tools/chocolateyInstall.ps1

#### 2. Update `tools\chocolateyInstall.ps1`
#### 2. Create a branch

You need to update `$url`, `$url64`, `$checksum` and `$checksum64`
variables below.
Create a branch and push it.

* URLs must point to `get.docker.com` for stable releases, ask
the release captain for release candidate (rc) URLs.
* Checksums can be found by adding `.md5` extension to the URLs.
git checkout -b update-docker-1.10.3
git add docker.nuspec appveyor.yml tools/chocolateyInstall.ps1
git push -u origin update-docker-1.10.3

Example:
#### 3. Create a pull request

$url = 'http://test.docker.com.s3.amazonaws.com/builds/Windows/i386/docker-1.6.0-rc2.exe'
$checksum = 'b87e30265310a9221ed4f4926ae3d579'
....
$url64 = 'http://test.docker.com.s3.amazonaws.com/builds/Windows/x86_64/docker-1.6.0-rc2.exe'
$checksum64 = '32524cf8ff385ae93356c7bc8f321393'
With the new branch create a pull request. Now check AppVeyor build status.

#### 3. Package it
#### 4. Merge pull request

Open a command line window and run the following command in the folder
where `docker.nuspec` exists:
At GitHub merge the pull request if all the tests from AppVeyor are green.

nuget pack
#### 5. Draft a release

It might show some warnings, but if there's no errors, it's completed.
Check if a `.nupkg` file exists in the same directory after this.
Now draft a new release at https://github.com/ahmetalpbalkan/docker-chocolatey/releases/new
Enter eg. 1.10.3 in the field "Tag version" and "Release title" and add some nice description.

#### 4. Install it locally

First, make sure `docker` is not installed (or not in %PATH%). (Cleanest
way to do this is to run inside a clean virtual machine but that's not
always necessary).

Use the following command to install the nupkg locally (the directory
used below is where the `docker*.nupkg` exists):

choco install docker -source c:\git\docker-chocolatey

> NOTE: If the version is pre-release (e.g. a RC), you need to provide
> `-pre` flag to the command above as well.
The command above must be installing docker correctly. Run `docker -v`
to verify if it is installed.

Repeat the `choco install` command with an additional `-x86` flag to
make sure 32-bit version installs correctly, too.

Run the following commands to verify uninstallation works:

choco uninstall docker
docker // shouldn't work

#### 5. Upload the package

> **CAUTION:** You can upload a version only once (chocolatey does not
> allow overwriting packages). Therefore be careful since you can do
> this step only once without changing `<version>` string.
Go to http://chocolatey.org and log in.

Click **Upload** tab.

Choose the binary.

Review the version number and details.

Hit "Upload" button.
AppVeyor then builds the package again, tests it and then pushes it to Chocolatey for approval.

#### 6. Approval Process

Expand All @@ -101,10 +56,10 @@ allow the package before it is published. This usually takes a day or
so. (If it takes any longer, ping @ferventcoder).

If a package is **pre-release** (i.e. has `-rc1`, `-beta` like strings
in its version) then the submission **does not need moderator approval**
in its version) then the submission **does not need moderator approval**
and you will see a message like this:

> "*This package is exempt from moderation. While it is likely safe for you,
> "*This package is exempt from moderation. While it is likely safe for you,
> there is more risk involved.*"
The difference is, users install stable packages with:
Expand All @@ -121,5 +76,3 @@ messages if the package is pre-release.
#### 7. Profit

Package will be published at https://chocolatey.org/packages/docker


2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.10.3.{build}
version: 1.11.0.{build}
environment:
TOKEN:
secure: KE3DuBSMhbBxLurkOXLrmAFbF+zptuCJztv1LDq1DfU65A1NSoYTI9JpYE63h/66
Expand Down
2 changes: 1 addition & 1 deletion docker.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- Read this before publishing packages to chocolatey.org: https://github.com/chocolatey/chocolatey/wiki/CreatePackages -->
<id>docker</id>
<title>Docker</title>
<version>1.10.3</version>
<version>1.11.0</version>
<authors>Docker Contributors</authors>
<owners>ahmetalpbalkan</owners>
<summary>Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications.</summary>
Expand Down
16 changes: 6 additions & 10 deletions tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
$packageName = 'docker'
$url = 'https://get.docker.com/builds/Windows/i386/docker-1.10.3.exe'
$checksum = '943235a4e0f3b1b8a214cca1d81e4693'
$url64 = 'https://get.docker.com/builds/Windows/x86_64/docker-1.10.3.exe'
$checksum64 = '4d9c818967d729f38931edbe33c28398'
$url = 'https://get.docker.com/builds/Windows/i386/docker-1.11.0.zip'
$checksum = 'f8bbf3bd40c9939513f5023f5107e9b2'
$url64 = 'https://get.docker.com/builds/Windows/x86_64/docker-1.11.0.zip'
$checksum64 = '1474613540062ba4d28496e060da5e15'
$checksumType = 'md5'
$checksumType64 = 'md5'
$validExitCodes = @(0)

$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$packageDir = "$(Split-Path -parent $toolsDir)"
$installDir = Join-Path "$packageDir" "bin"
$installBin = "${packageName}.exe"
$installPath = Join-Path "$installDir" "$installBin"

New-Item -ItemType Directory -Force -Path "$installDir"
Get-ChocolateyWebFile "$packageName" "$installPath" "$url" "$url64" -checksum "$checksum" -checksumType "$checksumType" -checksum64 "$checksum64" -checksumType64 "$checksumType64"
Install-ChocolateyZipPackage "docker" "$url" "$toolsDir" "$url64" `
-checksum $checksum -checksumType $checksumType -checksum64 $checksum64 -checksumType64 $checksumType64
29 changes: 29 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

if [ "$1" = "" ]; then
echo "Usage: $0 version"
echo "Update the choco package to a given version"
echo "Example: $0 1.10.3"
exit 1
fi

if [[ "${OSTYPE}" != "darwin"* ]]; then
echo "This version does only support Mac."
exit 2
fi

version=$1

url="https://get.docker.com/builds/Windows/i386/docker-${version}.zip"
url64="https://get.docker.com/builds/Windows/x86_64/docker-${version}.zip"
checksum=$(curl "${url}.md5" | cut -f 1 -d " ")
checksum64=$(curl "${url64}.md5" | cut -f 1 -d " ")

sed -i.bak "s/<version>.*<\/version>/<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

0 comments on commit b347e95

Please sign in to comment.