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

34 行
869 B

  1. #!/usr/bin/env bash
  2. function check_env_variables_are_setted {
  3. if [ -z "${QUAY_USERNAME}" ] || [ -z "${QUAY_PASSWORD}" ]; then
  4. echo "Need to set QUAY_USERNAME and QUAY_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. pushd containers
  15. container=$1
  16. docker build --tag lesspass/${container} ./${container}
  17. docker tag lesspass/${container} quay.io/lesspass/${container}
  18. docker push quay.io/lesspass/${container}
  19. popd
  20. }
  21. function build_and_push_containers {
  22. docker login --username="${QUAY_USERNAME}" --password="${QUAY_PASSWORD}" quay.io
  23. build_and_push_container webserver
  24. build_and_push_container backend
  25. build_and_push_container frontend
  26. }
  27. build_and_push_containers