mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #2612 from tianon/release-script-tweaks
* Hack: release script tweaks
This commit is contained in:
commit
3885ef585b
1 changed files with 17 additions and 6 deletions
|
@ -97,7 +97,7 @@ write_to_s3() {
|
||||||
DEST=$1
|
DEST=$1
|
||||||
F=`mktemp`
|
F=`mktemp`
|
||||||
cat > $F
|
cat > $F
|
||||||
s3cmd --acl-public put $F $DEST
|
s3cmd --acl-public --mime-type='text/plain' put $F $DEST
|
||||||
rm -f $F
|
rm -f $F
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,14 +107,14 @@ s3_url() {
|
||||||
echo "https://$BUCKET"
|
echo "https://$BUCKET"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "http://$BUCKET.s3.amazonaws.com"
|
s3cmd ws-info s3://$BUCKET | awk -v 'FS=: +' '/http:\/\/'$BUCKET'/ { gsub(/\/+$/, "", $2); print $2 }'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# Upload the 'ubuntu' bundle to S3:
|
# Upload the 'ubuntu' bundle to S3:
|
||||||
# 1. A full APT repository is published at $BUCKET/ubuntu/
|
# 1. A full APT repository is published at $BUCKET/ubuntu/
|
||||||
# 2. Instructions for using the APT repository are uploaded at $BUCKET/ubuntu/info
|
# 2. Instructions for using the APT repository are uploaded at $BUCKET/ubuntu/index
|
||||||
release_ubuntu() {
|
release_ubuntu() {
|
||||||
[ -e bundles/$VERSION/ubuntu ] || {
|
[ -e bundles/$VERSION/ubuntu ] || {
|
||||||
echo >&2 './hack/make.sh must be run before release_ubuntu'
|
echo >&2 './hack/make.sh must be run before release_ubuntu'
|
||||||
|
@ -168,7 +168,7 @@ EOF
|
||||||
|
|
||||||
# Upload repo
|
# Upload repo
|
||||||
s3cmd --acl-public sync $APTDIR/ s3://$BUCKET/ubuntu/
|
s3cmd --acl-public sync $APTDIR/ s3://$BUCKET/ubuntu/
|
||||||
cat <<EOF | write_to_s3 s3://$BUCKET/ubuntu/info
|
cat <<EOF | write_to_s3 s3://$BUCKET/ubuntu/index
|
||||||
# Add the repository to your APT sources
|
# Add the repository to your APT sources
|
||||||
echo deb $(s3_url)/ubuntu docker main > /etc/apt/sources.list.d/docker.list
|
echo deb $(s3_url)/ubuntu docker main > /etc/apt/sources.list.d/docker.list
|
||||||
# Then import the repository key
|
# Then import the repository key
|
||||||
|
@ -180,7 +180,12 @@ apt-get update ; apt-get install -y lxc-docker
|
||||||
# Alternatively, just use the curl-able install.sh script provided at $(s3_url)
|
# Alternatively, just use the curl-able install.sh script provided at $(s3_url)
|
||||||
#
|
#
|
||||||
EOF
|
EOF
|
||||||
echo "APT repository uploaded. Instructions available at $(s3_url)/ubuntu/info"
|
|
||||||
|
# Add redirect at /ubuntu/info for URL-backwards-compatibility
|
||||||
|
rm -rf /tmp/emptyfile && touch /tmp/emptyfile
|
||||||
|
s3cmd --acl-public --add-header='x-amz-website-redirect-location:/ubuntu/' --mime-type='text/plain' put /tmp/emptyfile s3://$BUCKET/ubuntu/info
|
||||||
|
|
||||||
|
echo "APT repository uploaded. Instructions available at $(s3_url)/ubuntu"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Upload a static binary to S3
|
# Upload a static binary to S3
|
||||||
|
@ -189,14 +194,20 @@ release_binary() {
|
||||||
echo >&2 './hack/make.sh must be run before release_binary'
|
echo >&2 './hack/make.sh must be run before release_binary'
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
S3DIR=s3://$BUCKET/builds/Linux/x86_64
|
S3DIR=s3://$BUCKET/builds/Linux/x86_64
|
||||||
s3cmd --acl-public put bundles/$VERSION/binary/docker-$VERSION $S3DIR/docker-$VERSION
|
s3cmd --acl-public put bundles/$VERSION/binary/docker-$VERSION $S3DIR/docker-$VERSION
|
||||||
cat <<EOF | write_to_s3 s3://$BUCKET/builds/info
|
cat <<EOF | write_to_s3 s3://$BUCKET/builds/index
|
||||||
# To install, run the following command as root:
|
# To install, run the following command as root:
|
||||||
curl -O $(s3_url)/builds/Linux/x86_64/docker-$VERSION && chmod +x docker-$VERSION && sudo mv docker-$VERSION /usr/local/bin/docker
|
curl -O $(s3_url)/builds/Linux/x86_64/docker-$VERSION && chmod +x docker-$VERSION && sudo mv docker-$VERSION /usr/local/bin/docker
|
||||||
# Then start docker in daemon mode:
|
# Then start docker in daemon mode:
|
||||||
sudo /usr/local/bin/docker -d
|
sudo /usr/local/bin/docker -d
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Add redirect at /builds/info for URL-backwards-compatibility
|
||||||
|
rm -rf /tmp/emptyfile && touch /tmp/emptyfile
|
||||||
|
s3cmd --acl-public --add-header='x-amz-website-redirect-location:/builds/' --mime-type='text/plain' put /tmp/emptyfile s3://$BUCKET/builds/info
|
||||||
|
|
||||||
if [ -z "$NOLATEST" ]; then
|
if [ -z "$NOLATEST" ]; then
|
||||||
echo "Copying docker-$VERSION to docker-latest"
|
echo "Copying docker-$VERSION to docker-latest"
|
||||||
s3cmd --acl-public cp $S3DIR/docker-$VERSION $S3DIR/docker-latest
|
s3cmd --acl-public cp $S3DIR/docker-$VERSION $S3DIR/docker-latest
|
||||||
|
|
Loading…
Add table
Reference in a new issue