您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

31 行
969 B

  1. #!/usr/bin/env bash
  2. function check_env_variables_are_setted {
  3. if [ -z "${QUAY_USERNAME}" ] || [ -z "${QUAY_PASSWORD}" ] || [ -z "${DOCKER_PASSWORD}" ] || [ -z "${DOCKER_PASSWORD}" ]; then
  4. echo "Need to set QUAY_USERNAME, QUAY_PASSWORD, DOCKER_PASSWORD and DOCKER_PASSWORD env variables to release containers"
  5. exit 1
  6. fi
  7. }
  8. set +o errexit
  9. check_env_variables_are_setted
  10. set -o errexit
  11. set -o pipefail
  12. set -o nounset
  13. function build_and_push_container {
  14. container=$1
  15. docker build --tag lesspass/${container} ./${container}
  16. docker push lesspass/${container}
  17. docker tag lesspass/${container} quay.io/lesspass/${container}
  18. docker push quay.io/lesspass/${container}
  19. }
  20. docker login --username="${DOCKER_USERNAME}" --password="${DOCKER_PASSWORD}"
  21. docker login --username="${QUAY_USERNAME}" --password="${QUAY_PASSWORD}" quay.io
  22. build_and_push_container webserver
  23. build_and_push_container backend
  24. build_and_push_container frontend