release.sh 916 B

1234567891011121314151617181920212223242526
  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=$HOME/.gitconfig,target=/root/.gitconfig \
  19. --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
  20. --mount type=bind,source=$HOME/.ssh,target=/root/.ssh \
  21. -v $HOME/.pypirc:/root/.pypirc \
  22. compose/release-tool $*