25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
875 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. container=$1
  15. docker build --tag lesspass/${container} ./${container}
  16. docker tag lesspass/${container} quay.io/lesspass/${container}
  17. docker push quay.io/lesspass/${container}
  18. }
  19. function build_and_push_containers {
  20. docker login --username="${QUAY_USERNAME}" --password="${QUAY_PASSWORD}" quay.io
  21. build_and_push_container webserver
  22. build_and_push_container backend
  23. build_and_push_container frontend
  24. # build_and_push_container blog
  25. }
  26. build_and_push_containers