github.com/skatsuta/docker@v1.8.1/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  
    42  if [[ "$VERSION" == *-rc* ]]; then
    43  	component="testing"
    44  	priority=650
    45  fi
    46  
    47  if [ $DOCKER_EXPERIMENTAL ] || [[ "$VERSION" == *-dev ]] || [ -n "$(git status --porcelain)" ]; then
    48  	component="experimental"
    49  	priority=600
    50  fi
    51  
    52  # release the debs
    53  for dir in contrib/builder/deb/*/; do
    54  	version="$(basename "$dir")"
    55  	codename="${version//debootstrap-}"
    56  
    57  	# add the deb for each component for the distro version with reprepro
    58  	DEBFILE=( "bundles/$VERSION/build-deb/$version/docker-engine"*.deb )
    59  
    60  	# if we have a $GPG_PASSPHRASE we may as well
    61  	# dpkg-sign before reprepro
    62  	if [ ! -z "$GPG_PASSPHRASE" ]; then
    63  		dpkg-sig -g "--passphrase $GPG_PASSPHRASE" \
    64  			-k releasedocker --sign builder "${DEBFILE[@]}"
    65  	fi
    66  
    67  	reprepro -v --keepunreferencedfiles \
    68  		-S docker-engine -P "$priority" -C "$component" \
    69  		-b "$APTDIR" includedeb "$codename" "${DEBFILE[@]}"
    70  done