mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Release script also takes care of index file (if the S3 bucket is WS-enabled)
This commit is contained in:
parent
5b630d436d
commit
0469e47674
3 changed files with 32 additions and 16 deletions
|
@ -35,10 +35,10 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Downloading docker binary and uncompressing into /usr/local/bin..."
|
echo "Downloading docker binary to /usr/local/bin..."
|
||||||
curl -s https://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-latest.tgz |
|
curl -s https://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-latest \
|
||||||
tar -C /usr/local/bin --strip-components=1 -zxf- \
|
> /usr/local/bin/docker
|
||||||
docker-latest/docker
|
chmod +x /usr/local/bin/docker
|
||||||
|
|
||||||
if [ -f /etc/init/dockerd.conf ]
|
if [ -f /etc/init/dockerd.conf ]
|
||||||
then
|
then
|
||||||
|
@ -50,7 +50,7 @@ description "Docker daemon"
|
||||||
start on filesystem or runlevel [2345]
|
start on filesystem or runlevel [2345]
|
||||||
stop on runlevel [!2345]
|
stop on runlevel [!2345]
|
||||||
respawn
|
respawn
|
||||||
exec env LANG="en_US.UTF-8" /usr/local/bin/docker -d
|
exec /usr/local/bin/docker -d
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
21
make.sh
21
make.sh
|
@ -51,6 +51,16 @@ Docker is a great building block for automating distributed systems:
|
||||||
large-scale web deployments, database clusters, continuous deployment systems,
|
large-scale web deployments, database clusters, continuous deployment systems,
|
||||||
private PaaS, service-oriented architectures, etc."
|
private PaaS, service-oriented architectures, etc."
|
||||||
|
|
||||||
|
UPSTART_SCRIPT='description "Docker daemon"
|
||||||
|
|
||||||
|
start on filesystem or runlevel [2345]
|
||||||
|
stop on runlevel [!2345]
|
||||||
|
|
||||||
|
respawn
|
||||||
|
|
||||||
|
exec docker -d
|
||||||
|
'
|
||||||
|
|
||||||
# Each "bundle" is a different type of build artefact: static binary, Ubuntu
|
# Each "bundle" is a different type of build artefact: static binary, Ubuntu
|
||||||
# package, etc.
|
# package, etc.
|
||||||
|
|
||||||
|
@ -86,16 +96,7 @@ bundle_ubuntu() {
|
||||||
|
|
||||||
# Generate an upstart config file (ubuntu-specific)
|
# Generate an upstart config file (ubuntu-specific)
|
||||||
mkdir -p $DIR/etc/init
|
mkdir -p $DIR/etc/init
|
||||||
cat > $DIR/etc/init/docker.conf <<EOF
|
echo "$UPSTART_SCRIPT" > $DIR/etc/init/docker.conf
|
||||||
description "Run docker"
|
|
||||||
|
|
||||||
start on filesystem or runlevel [2345]
|
|
||||||
stop on runlevel [!2345]
|
|
||||||
|
|
||||||
respawn
|
|
||||||
|
|
||||||
exec docker -d
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Copy the binary
|
# Copy the binary
|
||||||
mkdir -p $DIR/usr/bin
|
mkdir -p $DIR/usr/bin
|
||||||
|
|
17
release.sh
17
release.sh
|
@ -48,12 +48,14 @@ BUCKET=$AWS_S3_BUCKET
|
||||||
|
|
||||||
setup_s3() {
|
setup_s3() {
|
||||||
# Try creating the bucket. Ignore errors (it might already exist).
|
# Try creating the bucket. Ignore errors (it might already exist).
|
||||||
s3cmd --acl-public mb s3://$BUCKET 2>/dev/null || true
|
s3cmd mb s3://$BUCKET 2>/dev/null || true
|
||||||
# Check access to the bucket.
|
# Check access to the bucket.
|
||||||
# s3cmd has no useful exit status, so we cannot check that.
|
# s3cmd has no useful exit status, so we cannot check that.
|
||||||
# Instead, we check if it outputs anything on standard output.
|
# Instead, we check if it outputs anything on standard output.
|
||||||
# (When there are problems, it uses standard error instead.)
|
# (When there are problems, it uses standard error instead.)
|
||||||
s3cmd info s3://$BUCKET | grep -q .
|
s3cmd info s3://$BUCKET | grep -q .
|
||||||
|
# Make the bucket accessible through website endpoints.
|
||||||
|
s3cmd ws-create --ws-index index --ws-error error s3://$BUCKET
|
||||||
}
|
}
|
||||||
|
|
||||||
# write_to_s3 uploads the contents of standard input to the specified S3 url.
|
# write_to_s3 uploads the contents of standard input to the specified S3 url.
|
||||||
|
@ -152,10 +154,23 @@ EOF
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Upload the index script
|
||||||
|
release_index() {
|
||||||
|
(
|
||||||
|
if [ "$BUCKET" != "get.docker.io" ]
|
||||||
|
then
|
||||||
|
sed s,https://get.docker.io/,http://$BUCKET.s3.amazonaws.com/, contrib/install.sh
|
||||||
|
else
|
||||||
|
cat contrib/install.sh
|
||||||
|
fi
|
||||||
|
) | write_to_s3 s3://$BUCKET/index
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
setup_s3
|
setup_s3
|
||||||
release_binary
|
release_binary
|
||||||
release_ubuntu
|
release_ubuntu
|
||||||
|
release_index
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
Loading…
Add table
Reference in a new issue