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

31 lines
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