release.sh 844 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. docker image inspect compose/release-tool > /dev/null
  3. if test $? -ne 0; then
  4. docker build -t compose/release-tool -f $(pwd)/script/release/Dockerfile $(pwd)
  5. fi
  6. if test -z $GITHUB_TOKEN; then
  7. echo "GITHUB_TOKEN environment variable must be set"
  8. exit 1
  9. fi
  10. if test -z $BINTRAY_TOKEN; then
  11. echo "BINTRAY_TOKEN environment variable must be set"
  12. exit 1
  13. fi
  14. docker run -e GITHUB_TOKEN=$GITHUB_TOKEN -e BINTRAY_TOKEN=$BINTRAY_TOKEN -it \
  15. --mount type=bind,source=$(pwd),target=/src \
  16. --mount type=bind,source=$(pwd)/.git,target=/src/.git \
  17. --mount type=bind,source=$HOME/.docker,target=/root/.docker \
  18. --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
  19. --mount type=bind,source=$HOME/.ssh,target=/root/.ssh \
  20. -v $HOME/.pypirc:/root/.pypirc \
  21. compose/release-tool $*