Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

1234567891011121314151617181920212223242526272829303132
  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. }
  25. build_and_push_containers