update-deb.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env bash
  2. RELEASE_TYPE="${1:-}"
  3. GPG_PASS="${2:-}"
  4. if [ -z "$RELEASE_TYPE" -o -z "$GPG_PASS" ]; then
  5. echo "Both RELEASE_TYPE (arg 1) and GPG_PASS (arg 2) has to be set"
  6. exit 1
  7. fi
  8. set -e
  9. # Setup environment
  10. cp scripts/build/update_repo/aptly.conf /etc/aptly.conf
  11. mkdir -p /deb-repo/db
  12. mkdir -p /deb-repo/repo
  13. # Download the database
  14. gsutil -m rsync -r gs://grafana-aptly-db/repo-db /deb-repo/db
  15. # Add the new release to the repo
  16. set +e
  17. aptly publish drop squeeze filesystem:repo:grafana
  18. set -e
  19. aptly repo add grafana ./dist
  20. # Setup signing and sign the repo
  21. echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf
  22. echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
  23. ./scripts/build/update_repo/sign-deb-repo.sh "$GPG_PASS"
  24. # Update the repo and db on gcp
  25. gsutil -m rsync -r -d /deb-repo/db gs://grafana-aptly-db/repo-db
  26. gsutil -m rsync -r -d /deb-repo/repo/grafana "gs://grafana-repo/$RELEASE_TYPE/deb"
  27. # usage:
  28. # deb https://grafana-repo.storage.googleapis.com/oss/deb squeeze main
  29. #
  30. # later:
  31. # deb https://repo.grafana.com/oss/deb squeeze main