unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Proposed changes to release target
@ 2011-07-04 12:03 david
  2011-07-04 12:03 ` [PATCH 1/6] build-system: replace use of ssh with wget for checking the website david
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: david @ 2011-07-04 12:03 UTC (permalink / raw)
  To: notmuch

When pushing 0.6 out the door, I found the release target in Makefile
daunting.  This was partly lack of confidence/understanding on my
part: I didn't really like the idea of starting a chain of events that
I didn't fully understand that ended up copying files to the web site.
Also, it didn't quite work for me, because my git-buildpackage
configuration changed the location of the build-area.

This sequence of commits modifies the release target so that it 
does a "dry run" by default, unless REALLY_UPLOAD=yes is passed.

I considered making a separate target for the uploading part of
releasing, but getting the dependencies right seemed a bit tricky.

I guess the part that might be inconvenient from Carl's point of view
is removing the automatic building and uploading to Debian. My
reasoning for this is discussed in the relevant commit message.  I'd
be happy to have a seperate target that did this, although I
personally would not use such a target.

Summary:

 [PATCH 1/6] build-system: replace use of ssh with wget for checking
 [PATCH 2/6] build-system: remove calls to git-buildpackage and dput
 [PATCH 3/6] build-system: tag earlier in the release process.
 [PATCH 4/6] build-system: use signed tag to make tar file, if available
 [PATCH 5/6] build-system: Use existing signed tag for release, if present
 [PATCH 6/6] build-system: guard parts irrevokable parts of release

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/6] build-system: replace use of ssh with wget for checking the website
  2011-07-04 12:03 Proposed changes to release target david
@ 2011-07-04 12:03 ` david
  2011-07-04 12:03 ` [PATCH 2/6] build-system: remove calls to git-buildpackage and dput in release target david
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: david @ 2011-07-04 12:03 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

From: David Bremner <bremner@debian.org>

The idea is to see if the version we are already releasing exists on
the notmuch website. Using wget allows more people to run this target,
and also allows people with ssh access to run it without access to
their keys.
---
 Makefile.local |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index 8a8832d..41feeb3 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -180,11 +180,16 @@ verify-version-components:
 .PHONY: verify-newer
 verify-newer:
 	@echo -n "Checking that no $(VERSION) release already exists..."
-	@ssh $(RELEASE_HOST) test ! -e $(RELEASE_DIR)/$(TAR_FILE) \
-		|| (echo "Ouch." && echo "Found: $(RELEASE_HOST):$(RELEASE_DIR)/$(TAR_FILE)" \
-		&& echo "Refusing to replace an existing release." \
-		&& echo "Don't forget to update \"version\" as described in RELEASING before release." && false)
-	@echo "Good."
+	@wget -q -O /dev/null $(RELEASE_URL)/$(TAR_FILE) ; \
+	case $$? in \
+          8) echo "Good." ;; \
+          0) echo "Ouch."; \
+	     echo "Found: $(RELEASE_URL)/$(TAR_FILE)"; \
+	     echo "Refusing to replace an existing release."; \
+	     echo "Don't forget to update \"version\" as described in RELEASING before release." ; \
+	     false ;; \
+	  *) echo "An unexpected error occured"; \
+	     false;; esac
 
 # The user has not set any verbosity, default to quiet mode and inform the
 # user how to enable verbose compiles.
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/6] build-system: remove calls to git-buildpackage and dput in release target.
  2011-07-04 12:03 Proposed changes to release target david
  2011-07-04 12:03 ` [PATCH 1/6] build-system: replace use of ssh with wget for checking the website david
@ 2011-07-04 12:03 ` david
  2011-07-04 12:03 ` [PATCH 3/6] build-system: tag earlier in the release process david
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: david @ 2011-07-04 12:03 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

From: David Bremner <bremner@debian.org>

The removed code had the following issues:

- It depends on the users git-buildpackage configuration to put the
results in the correct place, so is fragile.

- The tar file is overwritten in the next step, so copying it is not
  useful.

- We should build the final version of the debian package in a chroot,
  using e.g. pbuilder or sbuild.

I added a call to "make clean", so that we are sure the code is
completely rebuilt before testing.
---
 Makefile.local |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index 41feeb3..dea813c 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -87,18 +87,13 @@ dist: $(TAR_FILE)
 .PHONY: release
 release: verify-source-tree-and-version
 	$(MAKE) VERSION=$(VERSION) verify-newer
+	$(MAKE) VERSION=$(VERSION) clean
 	$(MAKE) VERSION=$(VERSION) test
-	rm -rf ./debian-build
-	git-buildpackage
-	cp debian-build/notmuch_$(VERSION).tar.gz notmuch-$(VERSION).tar.gz
 	$(MAKE) VERSION=$(VERSION) $(GPG_FILE)
 	scp $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE) $(RELEASE_HOST):$(RELEASE_DIR)
 	ssh $(RELEASE_HOST) "rm -f $(RELEASE_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(TAR_FILE) $(RELEASE_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
 	mkdir -p releases
 	mv $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE) releases
-	(cd debian-build; dput *.changes)
-	mv debian-build/* releases
-	rmdir debian-build
 	git tag -s -m "$(PACKAGE) $(VERSION) release" $(VERSION)
 	git push origin $(VERSION)
 	$(MAKE) VERSION=$(VERSION) release-message > $(PACKAGE)-$(VERSION).announce
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/6] build-system: tag earlier in the release process.
  2011-07-04 12:03 Proposed changes to release target david
  2011-07-04 12:03 ` [PATCH 1/6] build-system: replace use of ssh with wget for checking the website david
  2011-07-04 12:03 ` [PATCH 2/6] build-system: remove calls to git-buildpackage and dput in release target david
@ 2011-07-04 12:03 ` david
  2011-07-04 12:03 ` [PATCH 4/6] build-system: use signed tag to make tar file, if available david
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: david @ 2011-07-04 12:03 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

From: David Bremner <bremner@debian.org>

If tagging fails, we really don't want to upload tarballs.
---
 Makefile.local |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index dea813c..b6445e5 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -89,12 +89,12 @@ release: verify-source-tree-and-version
 	$(MAKE) VERSION=$(VERSION) verify-newer
 	$(MAKE) VERSION=$(VERSION) clean
 	$(MAKE) VERSION=$(VERSION) test
+	git tag -s -m "$(PACKAGE) $(VERSION) release" $(VERSION)
 	$(MAKE) VERSION=$(VERSION) $(GPG_FILE)
 	scp $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE) $(RELEASE_HOST):$(RELEASE_DIR)
 	ssh $(RELEASE_HOST) "rm -f $(RELEASE_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(TAR_FILE) $(RELEASE_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
 	mkdir -p releases
 	mv $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE) releases
-	git tag -s -m "$(PACKAGE) $(VERSION) release" $(VERSION)
 	git push origin $(VERSION)
 	$(MAKE) VERSION=$(VERSION) release-message > $(PACKAGE)-$(VERSION).announce
 	@echo "Please send a release announcement using $(PACKAGE)-$(VERSION).announce as a template."
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/6] build-system: use signed tag to make tar file, if available.
  2011-07-04 12:03 Proposed changes to release target david
                   ` (2 preceding siblings ...)
  2011-07-04 12:03 ` [PATCH 3/6] build-system: tag earlier in the release process david
@ 2011-07-04 12:03 ` david
  2011-07-04 12:03 ` [PATCH 5/6] build-system: Use existing signed tag for release, if present david
  2011-07-04 12:03 ` [PATCH 6/6] build-system: guard parts irrevokable parts of release target with REALLY_UPLOAD david
  5 siblings, 0 replies; 7+ messages in thread
From: david @ 2011-07-04 12:03 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

From: David Bremner <bremner@debian.org>

This as the advantage that "make VERSION=n.m dist" will work correctly
even if the wrong branch happens to be checked out.
---
 Makefile.local |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index b6445e5..d1c0737 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -60,7 +60,13 @@ endif
 endif
 
 $(TAR_FILE):
-	git archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ HEAD > $(TAR_FILE).tmp
+	if git tag -v $(VERSION) >/dev/null 2>&1; then \
+           ref=$(VERSION); \
+        else \
+           ref="HEAD" ; \
+	   echo "Warning: No signed tag for $(VERSION)"; \
+	fi ; \
+	git archive --format=tar --prefix=$(PACKAGE)-$(VERSION)/ $$ref > $(TAR_FILE).tmp
 	echo $(VERSION) > version.tmp
 	tar --append -f $(TAR_FILE).tmp --transform s_^_$(PACKAGE)-$(VERSION)/_  --transform 's_.tmp$$__' version.tmp
 	rm version.tmp
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/6] build-system: Use existing signed tag for release, if present.
  2011-07-04 12:03 Proposed changes to release target david
                   ` (3 preceding siblings ...)
  2011-07-04 12:03 ` [PATCH 4/6] build-system: use signed tag to make tar file, if available david
@ 2011-07-04 12:03 ` david
  2011-07-04 12:03 ` [PATCH 6/6] build-system: guard parts irrevokable parts of release target with REALLY_UPLOAD david
  5 siblings, 0 replies; 7+ messages in thread
From: david @ 2011-07-04 12:03 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

From: David Bremner <bremner@debian.org>

This is to support testing the release machinery without jumping
through hoops to delete and restore a tag, or bumping the version
number in both version and debian/changelog.
---
 Makefile.local |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index d1c0737..a291195 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -95,7 +95,7 @@ release: verify-source-tree-and-version
 	$(MAKE) VERSION=$(VERSION) verify-newer
 	$(MAKE) VERSION=$(VERSION) clean
 	$(MAKE) VERSION=$(VERSION) test
-	git tag -s -m "$(PACKAGE) $(VERSION) release" $(VERSION)
+	git tag -v $(VERSION) || git tag -s -m "$(PACKAGE) $(VERSION) release" $(VERSION)
 	$(MAKE) VERSION=$(VERSION) $(GPG_FILE)
 	scp $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE) $(RELEASE_HOST):$(RELEASE_DIR)
 	ssh $(RELEASE_HOST) "rm -f $(RELEASE_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(TAR_FILE) $(RELEASE_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 6/6] build-system: guard parts irrevokable parts of release target with REALLY_UPLOAD
  2011-07-04 12:03 Proposed changes to release target david
                   ` (4 preceding siblings ...)
  2011-07-04 12:03 ` [PATCH 5/6] build-system: Use existing signed tag for release, if present david
@ 2011-07-04 12:03 ` david
  5 siblings, 0 replies; 7+ messages in thread
From: david @ 2011-07-04 12:03 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

From: David Bremner <bremner@debian.org>

This supports both testing and use by non-upload privileged
users. Along with previous commits in the series, this lets one do a
dry run of the release process and created a tarball, signature file,
and release announcement to inspect before uploading.
---
 Makefile.local |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index a291195..6b2a3a7 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -97,12 +97,14 @@ release: verify-source-tree-and-version
 	$(MAKE) VERSION=$(VERSION) test
 	git tag -v $(VERSION) || git tag -s -m "$(PACKAGE) $(VERSION) release" $(VERSION)
 	$(MAKE) VERSION=$(VERSION) $(GPG_FILE)
-	scp $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE) $(RELEASE_HOST):$(RELEASE_DIR)
-	ssh $(RELEASE_HOST) "rm -f $(RELEASE_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(TAR_FILE) $(RELEASE_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
 	mkdir -p releases
 	mv $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE) releases
-	git push origin $(VERSION)
 	$(MAKE) VERSION=$(VERSION) release-message > $(PACKAGE)-$(VERSION).announce
+ifeq ($(REALLY_UPLOAD),yes)
+	git push origin $(VERSION)
+	cd releases && scp $(TAR_FILE) $(SHA1_FILE) $(GPG_FILE) $(RELEASE_HOST):$(RELEASE_DIR)
+	ssh $(RELEASE_HOST) "rm -f $(RELEASE_DIR)/LATEST-$(PACKAGE)-[0-9]* ; ln -s $(TAR_FILE) $(RELEASE_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
+endif
 	@echo "Please send a release announcement using $(PACKAGE)-$(VERSION).announce as a template."
 
 .PHONY: release-message
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-07-04 12:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-04 12:03 Proposed changes to release target david
2011-07-04 12:03 ` [PATCH 1/6] build-system: replace use of ssh with wget for checking the website david
2011-07-04 12:03 ` [PATCH 2/6] build-system: remove calls to git-buildpackage and dput in release target david
2011-07-04 12:03 ` [PATCH 3/6] build-system: tag earlier in the release process david
2011-07-04 12:03 ` [PATCH 4/6] build-system: use signed tag to make tar file, if available david
2011-07-04 12:03 ` [PATCH 5/6] build-system: Use existing signed tag for release, if present david
2011-07-04 12:03 ` [PATCH 6/6] build-system: guard parts irrevokable parts of release target with REALLY_UPLOAD david

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).