github.com/rsampaio/docker@v0.7.2-0.20150827203920-fdc73cc3fc31/hack/make/release-deb (about)

     1  #!/bin/bash
     2  set -e
     3  
     4  # This script creates the apt repos for the .deb files generated by hack/make/build-deb
     5  #
     6  # The following can then be used as apt sources:
     7  # 	deb http://apt.dockerproject.org/repo $distro-$release $version
     8  #
     9  # For example:
    10  #	deb http://apt.dockerproject.org/repo ubuntu-trusy main
    11  #	deb http://apt.dockerproject.org/repo ubuntu-vivid testing
    12  #	deb http://apt.dockerproject.org/repo debian-wheezy experimental
    13  #	deb http://apt.dockerproject.org/repo debian-jessie main
    14  #
    15  # ... and so on and so forth for the builds created by hack/make/build-deb
    16  
    17  : ${DOCKER_RELEASE_DIR:=$DEST}
    18  APTDIR=$DOCKER_RELEASE_DIR/apt/repo
    19  
    20  # setup the apt repo (if it does not exist)
    21  mkdir -p "$APTDIR/conf" "$APTDIR/db"
    22  
    23  # create/update distributions file
    24  if [[ ! -f "$APTDIR/conf/distributions" ]]; then
    25  	for suite in $(exec contrib/reprepro/suites.sh); do
    26  		cat <<-EOF
    27  		Origin: Docker
    28  		Suite: $suite
    29  		Codename: $suite
    30  		Architectures: amd64 i386
    31  		Components: main testing experimental
    32  		Description: Docker APT Repository
    33  
    34  		EOF
    35  	done > "$APTDIR/conf/distributions"
    36  fi
    37  
    38  # set the component and priority for the version being released
    39  component="main"
    40  priority=700
    41  options="--keepunreferencedfiles"
    42  
    43  if [[ "$VERSION" == *-rc* ]]; then
    44  	component="testing"
    45  	priority=650
    46  fi
    47  
    48  if [ $DOCKER_EXPERIMENTAL ] || [[ "$VERSION" == *-dev ]] || [ -n "$(git status --porcelain)" ]; then
    49  	component="experimental"
    50  	priority=600
    51  	options=
    52  fi
    53  
    54  # release the debs
    55  for dir in contrib/builder/deb/*/; do
    56  	version="$(basename "$dir")"
    57  	codename="${version//debootstrap-}"
    58  
    59  	# add the deb for each component for the distro version with reprepro
    60  	DEBFILE=( "bundles/$VERSION/build-deb/$version/docker-engine"*.deb )
    61  
    62  	# if we have a $GPG_PASSPHRASE we may as well
    63  	# dpkg-sign before reprepro
    64  	if [ ! -z "$GPG_PASSPHRASE" ]; then
    65  		dpkg-sig -g "--passphrase $GPG_PASSPHRASE" \
    66  			-k releasedocker --sign builder "${DEBFILE[@]}"
    67  	fi
    68  
    69  	reprepro -v $options \
    70  		-S docker-engine -P "$priority" -C "$component" \
    71  		-b "$APTDIR" includedeb "$codename" "${DEBFILE[@]}"
    72  done