Browse code

Merge pull request #17714 from mikedougherty/cs-release-fixes

Fixes for release scripts

Tianon Gravi authored on 2015/11/24 12:47:10
Showing 5 changed files
... ...
@@ -5,7 +5,7 @@ cd "$(dirname "$BASH_SOURCE")/../.."
5 5
 
6 6
 targets_from() {
7 7
        git fetch -q https://github.com/docker/docker.git "$1"
8
-       git ls-tree -r --name-only origin/master contrib/builder/deb | grep '/Dockerfile$' | sed -r 's!^contrib/builder/deb/|-debootstrap|/Dockerfile$!!g'
8
+       git ls-tree -r --name-only "$(git rev-parse FETCH_HEAD)" contrib/builder/deb | grep '/Dockerfile$' | sed -r 's!^contrib/builder/deb/|-debootstrap|/Dockerfile$!!g'
9 9
 }
10 10
 
11 11
 release_branch=$(git ls-remote --heads https://github.com/docker/docker.git | awk -F 'refs/heads/' '$2 ~ /^release/ { print $2 }' | sort -V | tail -1)
... ...
@@ -257,7 +257,7 @@ main() {
257 257
 	# We want this to fail if the bundles already exist and cannot be removed.
258 258
 	# This is to avoid mixing bundles from different versions of the code.
259 259
 	mkdir -p bundles
260
-	if [ -e "bundles/$VERSION" ]; then
260
+	if [ -e "bundles/$VERSION" ] && [ -z "$KEEPBUNDLE" ]; then
261 261
 		echo "bundles/$VERSION already exists. Removing."
262 262
 		rm -fr "bundles/$VERSION" && mkdir "bundles/$VERSION" || exit 1
263 263
 		echo
... ...
@@ -14,7 +14,7 @@ Recommends: aufs-tools,
14 14
             xz-utils,
15 15
             ${apparmor:Recommends},
16 16
             ${yubico:Recommends}
17
-Conflicts: docker (<< 1.5~), docker.io, lxc-docker, lxc-docker-virtual-package
17
+Conflicts: docker (<< 1.5~), docker.io, lxc-docker, lxc-docker-virtual-package, docker-engine-cs
18 18
 Description: Docker: the open-source application container engine
19 19
  Docker is an open source project to build, ship and run any application as a
20 20
  lightweight container
... ...
@@ -91,6 +91,7 @@ Requires(pre): %{name}-selinux >= %{epoch}:%{version}-%{release}
91 91
 # conflicting packages
92 92
 Conflicts: docker
93 93
 Conflicts: docker-io
94
+Conflicts: docker-engine-cs
94 95
 
95 96
 %description
96 97
 Docker is an open source project to build, ship and run any application as a
... ...
@@ -23,7 +23,29 @@ mkdir -p "$APTDIR/conf" "$APTDIR/db"
23 23
 
24 24
 # supported arches/sections
25 25
 arches=( amd64 i386 )
26
-components=( main testing experimental )
26
+
27
+# Preserve existing components but don't add any non-existing ones
28
+for component in main testing experimental ; do
29
+	if ls "$APTDIR/dists/*/$component" >/dev/null 2>&1 ; then
30
+		components+=( $component )
31
+	fi
32
+done
33
+
34
+# set the component for the version being released
35
+component="main"
36
+
37
+if [[ "$VERSION" == *-rc* ]]; then
38
+	component="testing"
39
+fi
40
+
41
+if [ "$DOCKER_EXPERIMENTAL" ] || [[ "$VERSION" == *-dev ]] || [ -n "$(git status --porcelain)" ]; then
42
+	component="experimental"
43
+fi
44
+
45
+# Make sure our component is in the list of components
46
+if [[ ! "${components[*]}" =~ $component ]] ; then
47
+	components+=( $component )
48
+fi
27 49
 
28 50
 # create/update apt-ftparchive file
29 51
 if [ ! -f "$APTDIR/conf/apt-ftparchive.conf" ]; then
... ...
@@ -53,7 +75,7 @@ if [ ! -f "$APTDIR/conf/apt-ftparchive.conf" ]; then
53 53
 	for suite in $(exec contrib/reprepro/suites.sh); do
54 54
 		cat <<-EOF
55 55
 		Tree "dists/${suite}" {
56
-			Sections "main testing experimental";
56
+			Sections "${components[*]}";
57 57
 			Architectures "${arches[*]}";
58 58
 		}
59 59
 
... ...
@@ -70,17 +92,6 @@ if [ ! -f "$APTDIR/conf/docker-engine-release.conf" ]; then
70 70
 	EOF
71 71
 fi
72 72
 
73
-# set the component for the version being released
74
-component="main"
75
-
76
-if [[ "$VERSION" == *-rc* ]]; then
77
-	component="testing"
78
-fi
79
-
80
-if [ $DOCKER_EXPERIMENTAL ] || [[ "$VERSION" == *-dev ]] || [ -n "$(git status --porcelain)" ]; then
81
-	component="experimental"
82
-fi
83
-
84 73
 # release the debs
85 74
 for dir in contrib/builder/deb/*/; do
86 75
 	version="$(basename "$dir")"
... ...
@@ -91,7 +102,7 @@ for dir in contrib/builder/deb/*/; do
91 91
 	# if we have a $GPG_PASSPHRASE we may as well
92 92
 	# dpkg-sign before copying the deb into the pool
93 93
 	if [ ! -z "$GPG_PASSPHRASE" ]; then
94
-		dpkg-sig -g "--passphrase $GPG_PASSPHRASE" \
94
+		dpkg-sig -g "--no-tty --passphrase '$GPG_PASSPHRASE'" \
95 95
 			-k "$GPG_KEYID" --sign builder "${DEBFILE[@]}"
96 96
 	fi
97 97
 
... ...
@@ -100,6 +111,7 @@ for dir in contrib/builder/deb/*/; do
100 100
 	cp "${DEBFILE[@]}" "$APTDIR/pool/$component/d/docker-engine/"
101 101
 
102 102
 	# update the filelist for this codename/component
103
+	mkdir -p "$APTDIR/dists/$codename/$component"
103 104
 	find "$APTDIR/pool/$component" \
104 105
 		-name *~${codename#*-}*.deb > "$APTDIR/dists/$codename/$component/filelist"
105 106
 done
... ...
@@ -122,6 +134,7 @@ for dir in contrib/builder/deb/*/; do
122 122
 		"$APTDIR/dists/$codename" > "$APTDIR/dists/$codename/Release"
123 123
 
124 124
 	for arch in "${arches[@]}"; do
125
+		mkdir -p "$APTDIR/dists/$codename/$component/binary-$arch"
125 126
 		apt-ftparchive \
126 127
 			-o "APT::FTPArchive::Release::Codename=$codename" \
127 128
 			-o "APT::FTPArchive::Release::Suite=$codename" \