cloud-push 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env bash
  2. # Copyright Materialize, Inc. and contributors. All rights reserved.
  3. #
  4. # Use of this software is governed by the Business Source License
  5. # included in the LICENSE file at the root of this repository.
  6. #
  7. # As of the Change Date specified in that file, in accordance with
  8. # the Business Source License, use of this software will be governed
  9. # by the Apache License, Version 2.0.
  10. #
  11. # cloud-push – build cloud Docker images and push to personal Docker Hub.
  12. set -euo pipefail
  13. cd "$(dirname "$0")/.."
  14. . misc/shlib/shlib.bash
  15. if [[ $# -lt 2 ]]; then
  16. die "usage: $0 DOCKER-HUB-USERNAME ADDITIONAL-BUILD-METADATA [arguments for mzimage]"
  17. fi
  18. username=$1
  19. shift
  20. additional_build_metadata=$1
  21. shift
  22. version=$(bin/pyactivate -c "from materialize.mz_version import MzVersion; print(MzVersion.parse_cargo())")
  23. tag="$version--local.$additional_build_metadata"
  24. for image in environmentd clusterd; do
  25. bin/mzimage acquire --arch=aarch64 "$image" "$@"
  26. docker tag "$(bin/mzimage spec --arch=aarch64 "$image" "$@")" "$username/$image:$tag"
  27. docker push "$username/$image:$tag"
  28. done
  29. echo "Deploy this build to staging by running:"
  30. echo
  31. echo " $ bin/mz profile init --endpoint=https://staging.console.materialize.com --profile=staging"
  32. echo " $ bin/mz region enable --version $username:$tag --region=aws/us-east-1 --profile=staging"
  33. echo