From 04a1f431e392f62639ef13245ac8e7006c0e5af4 Mon Sep 17 00:00:00 2001 From: Adin Scannell Date: Fri, 29 May 2020 11:23:50 -0700 Subject: Fix the APT repository structure. This change fixes the apt repository structure to avoid emiting warnings on Ubuntu 18.04 (and potentially other versions). This requires a slight refactor of the repository generation scripts, since we can no longer copy the same release files for different "suites". This should avoid the warning by setting the suite to the distribution: https://github.com/Debian/apt/blob/master/apt-pkg/metaindex.cc#L75 This change also moves over to the standardized Makefile entrypoint, which makes settings clearer and enables local testing. PiperOrigin-RevId: 313817017 --- Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2bcb85e9b..80cb6851b 100644 --- a/Makefile +++ b/Makefile @@ -151,6 +151,33 @@ website-deploy: website-push ## Deploy a new version of the website. @gcloud run deploy $(WEBSITE_SERVICE) --platform=managed --region=$(WEBSITE_REGION) --project=$(WEBSITE_PROJECT) --image=$(WEBSITE_IMAGE) .PHONY: website-push +## +## Repository builders. +## +## This builds a local apt repository. The following variables may be set: +## RELEASE_ROOT - The repository root (default: "repo" directory). +## RELEASE_KEY - The repository GPG private key file (default: dummy key is created). +## RELEASE_NIGHTLY - Set to true if a nightly release (default: false). +## +RELEASE_ROOT := $(CURDIR)/repo +RELEASE_KEY := repo.key +RELEASE_NIGHTLY := false + +$(RELEASE_KEY): + @echo "WARNING: Generating a key for testing ($@); don't use this." + T=$$(mktemp /tmp/keyring.XXXXXX); \ + gpg --no-default-keyring --keyring $$T --batch --passphrase "" --quick-generate-key $(shell whoami) && \ + gpg --export-secret-keys --no-default-keyring --keyring $$T > $@; \ + rc=$$?; rm -f $$T; exit $$rc + +release: $(RELEASE_KEY) ## Builds a release. + @mkdir -p $(RELEASE_ROOT) + @T=$$(mktemp -d /tmp/release.XXXXXX); \ + $(MAKE) copy TARGETS="runsc runsc:runsc-debian" DESTINATION=$$T && \ + NIGHTLY=$(RELEASE_NIGHTLY) tools/make_release.sh $(RELEASE_KEY) $(RELEASE_ROOT) $$T/*; \ + rc=$$?; rm -rf $$T; exit $$rc +.PHONY: release + ## ## Development helpers and tooling. ## -- cgit v1.2.3