mirror of https://github.com/docker/docs.git
+CHANGES is now -dirty (works better in URLs), and we have postinstall and prerm jobs.
This commit is contained in:
parent
c8c69a1499
commit
a8059059c6
18
make.sh
18
make.sh
|
|
@ -10,7 +10,7 @@
|
||||||
# - The VERSION file, at the root of the repository, should exist, and
|
# - The VERSION file, at the root of the repository, should exist, and
|
||||||
# will be used as Docker binary version and package version.
|
# will be used as Docker binary version and package version.
|
||||||
# - The hash of the git commit will also be included in the Docker binary,
|
# - The hash of the git commit will also be included in the Docker binary,
|
||||||
# with the suffix +CHANGES if the repository isn't clean.
|
# with the suffix -dirty if the repository isn't clean.
|
||||||
# - The script is intented to be run as part of a docker build, as defined
|
# - The script is intented to be run as part of a docker build, as defined
|
||||||
# in the Dockerfile at the root of the source. In other words:
|
# in the Dockerfile at the root of the source. In other words:
|
||||||
# DO NOT CALL THIS SCRIPT DIRECTLY.
|
# DO NOT CALL THIS SCRIPT DIRECTLY.
|
||||||
|
|
@ -36,7 +36,7 @@ PKGVERSION="$VERSION"
|
||||||
GITCOMMIT=$(git rev-parse --short HEAD)
|
GITCOMMIT=$(git rev-parse --short HEAD)
|
||||||
if test -n "$(git status --porcelain)"
|
if test -n "$(git status --porcelain)"
|
||||||
then
|
then
|
||||||
GITCOMMIT="$GITCOMMIT+CHANGES"
|
GITCOMMIT="$GITCOMMIT-dirty"
|
||||||
PKGVERSION="$PKGVERSION-$(date +%Y%m%d%H%M%S)-$GITCOMMIT"
|
PKGVERSION="$PKGVERSION-$(date +%Y%m%d%H%M%S)-$GITCOMMIT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -102,10 +102,24 @@ bundle_ubuntu() {
|
||||||
mkdir -p $DIR/usr/bin
|
mkdir -p $DIR/usr/bin
|
||||||
cp bundles/$VERSION/binary/docker-$VERSION $DIR/usr/bin/docker
|
cp bundles/$VERSION/binary/docker-$VERSION $DIR/usr/bin/docker
|
||||||
|
|
||||||
|
# Generate postinstall/prerm scripts
|
||||||
|
cat >/tmp/postinstall <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
/sbin/stop docker || true
|
||||||
|
/sbin/start docker
|
||||||
|
EOF
|
||||||
|
cat >/tmp/prerm <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
/sbin/stop docker || true
|
||||||
|
EOF
|
||||||
|
chmod +x /tmp/postinstall /tmp/prerm
|
||||||
|
|
||||||
(
|
(
|
||||||
cd bundles/$VERSION/ubuntu
|
cd bundles/$VERSION/ubuntu
|
||||||
fpm -s dir -C $DIR \
|
fpm -s dir -C $DIR \
|
||||||
--name lxc-docker-$VERSION --version $PKGVERSION \
|
--name lxc-docker-$VERSION --version $PKGVERSION \
|
||||||
|
--after-install /tmp/postinstall \
|
||||||
|
--before-remove /tmp/prerm \
|
||||||
--architecture "$PACKAGE_ARCHITECTURE" \
|
--architecture "$PACKAGE_ARCHITECTURE" \
|
||||||
--prefix / \
|
--prefix / \
|
||||||
--depends lxc --depends aufs-tools \
|
--depends lxc --depends aufs-tools \
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ echo deb $(s3_url $BUCKET)/ubuntu docker main > /etc/apt/sources.list.d/docker.l
|
||||||
# Then import the repository key
|
# Then import the repository key
|
||||||
curl $(s3_url $BUCKET)/gpg | apt-key add -
|
curl $(s3_url $BUCKET)/gpg | apt-key add -
|
||||||
# Install docker
|
# Install docker
|
||||||
apt-get update ; apt-get install lxc-docker
|
apt-get update ; apt-get install -y lxc-docker
|
||||||
EOF
|
EOF
|
||||||
echo "APT repository uploaded. Instructions available at $(s3_url $BUCKET)/ubuntu/info"
|
echo "APT repository uploaded. Instructions available at $(s3_url $BUCKET)/ubuntu/info"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue