From d13f167d47c9dfd90198ddd239b1d7ae17a33577 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Wed, 16 Mar 2016 14:38:18 +0100 Subject: [PATCH] Add RELEASE_VERSION option to make deploy Now make deploy installs by default the current version, but can be made to install any prior specific version using a environmnt varialbe RELEASE_VERSION --- Makefile | 2 ++ src/pg/Makefile | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 43b8480..738b83e 100644 --- a/Makefile +++ b/Makefile @@ -29,5 +29,7 @@ release: # Install the current release. # The Python package is installed in a virtual environment envs/X.Y.Z/ # Requires sudo. +# Use the RELEASE_VERSION environment variable to deploy a specific version: +# sudo make deploy RELEASE_VERSION=1.0.0 deploy: $(MAKE) -C $(EXT_DIR) deploy diff --git a/src/pg/Makefile b/src/pg/Makefile index d81023c..ebe7009 100644 --- a/src/pg/Makefile +++ b/src/pg/Makefile @@ -61,15 +61,17 @@ release: ../../release/$(EXTENSION).control $(SOURCES_DATA) cp -r ../py/$(PACKAGE) ../../release/python/$(EXTVERSION)/ $(SED) -i -r 's/version='"'"'[0-9]+\.[0-9]+\.[0-9]+'"'"'/version='"'"'$(EXTVERSION)'"'"'/g' ../../release/python/$(EXTVERSION)/$(PACKAGE)/setup.py +RELEASE_VERSION ?= $(EXTVERSION) + # Install the current relese into the PostgreSQL extensions directory # and the Python package in a virtual environment envs/X.Y.Z deploy: $(INSTALL_DATA) ../../release/$(EXTENSION).control '$(DESTDIR)$(datadir)/extension/' $(INSTALL_DATA) ../../release/*.sql '$(DESTDIR)$(datadir)/extension/' # TODO: install also upgrade/downgrade files (manually generated) - virtualenv --system-site-packages $(VIRTUALENV_PATH)/$(EXTVERSION) - $(VIRTUALENV_PATH)/$(EXTVERSION)/bin/pip install -I -U ../../release/python/$(EXTVERSION)/$(PACKAGE) - $(VIRTUALENV_PATH)/$(EXTVERSION)/bin/pip install -I nose + virtualenv --system-site-packages $(VIRTUALENV_PATH)/$(RELEASE_VERSION) + $(VIRTUALENV_PATH)/$(RELEASE_VERSION)/bin/pip install -I -U ../../release/python/$(RELEASE_VERSION)/$(PACKAGE) + $(VIRTUALENV_PATH)/$(RELEASE_VERSION)/bin/pip install -I nose clean-dev: rm -f $(EXTENSION)--*.sql