| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 | #!/bin/bash## Create the official release#. "$(dirname "${BASH_SOURCE[0]}")/utils.sh"function usage() {    >&2 cat << EOMPublish a release by building all artifacts and pushing them.This script requires that 'git config branch.${BRANCH}.release' is set to therelease version for the release branch.EOM    exit 1}BRANCH="$(git rev-parse --abbrev-ref HEAD)"VERSION="$(git config "branch.${BRANCH}.release")" || usageif [ -z "$(command -v jq 2> /dev/null)" ]; then    >&2 echo "$0 requires https://stedolan.github.io/jq/"    >&2 echo "Please install it and make sure it is available on your \$PATH."    exit 2fiif [ -z "$(command -v pandoc 2> /dev/null)" ]; then    >&2 echo "$0 requires http://pandoc.org/"    >&2 echo "Please install it and make sure it is available on your \$PATH."    exit 2fiAPI=https://api.github.com/reposREPO=docker/compose[email protected]:$REPO# Check the build status is greensha=$(git rev-parse HEAD)url=$API/$REPO/statuses/$shabuild_status=$(curl -s $url | jq -r '.[0].state')if [ -n "$SKIP_BUILD_CHECK" ]; then    echo "Skipping build status check..."elif [[ "$build_status" != "success" ]]; then    >&2 echo "Build status is $build_status, but it should be success."    exit -1fiecho "Tagging the release as $VERSION"git tag $VERSIONgit push $GITHUB_REPO $VERSIONecho "Uploading the docker image"docker push docker/compose:$VERSIONecho "Uploading sdist to pypi"pandoc -f markdown -t rst README.md -o README.rstsed -i -e 's/logo.png?raw=true/https:\/\/github.com\/docker\/compose\/raw\/master\/logo.png?raw=true/' README.rst./script/build/write-git-shapython setup.py sdistif [ "$(command -v twine 2> /dev/null)" ]; then    twine upload ./dist/docker-compose-${VERSION/-/}.tar.gzelse    python setup.py uploadfiecho "Testing pip package"virtualenv venv-testsource venv-test/bin/activatepip install docker-compose==$VERSIONdocker-compose versiondeactivaterm -rf venv-testecho "Now publish the github release, and test the downloads."echo "Email [email protected] and [email protected] about the new release."
 |