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
This commit is contained in:
Javier Goizueta 2016-03-16 14:38:18 +01:00
parent a518034e65
commit d13f167d47
2 changed files with 7 additions and 3 deletions

View File

@ -29,5 +29,7 @@ release:
# Install the current release. # Install the current release.
# The Python package is installed in a virtual environment envs/X.Y.Z/ # The Python package is installed in a virtual environment envs/X.Y.Z/
# Requires sudo. # Requires sudo.
# Use the RELEASE_VERSION environment variable to deploy a specific version:
# sudo make deploy RELEASE_VERSION=1.0.0
deploy: deploy:
$(MAKE) -C $(EXT_DIR) deploy $(MAKE) -C $(EXT_DIR) deploy

View File

@ -61,15 +61,17 @@ release: ../../release/$(EXTENSION).control $(SOURCES_DATA)
cp -r ../py/$(PACKAGE) ../../release/python/$(EXTVERSION)/ 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 $(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 # Install the current relese into the PostgreSQL extensions directory
# and the Python package in a virtual environment envs/X.Y.Z # and the Python package in a virtual environment envs/X.Y.Z
deploy: deploy:
$(INSTALL_DATA) ../../release/$(EXTENSION).control '$(DESTDIR)$(datadir)/extension/' $(INSTALL_DATA) ../../release/$(EXTENSION).control '$(DESTDIR)$(datadir)/extension/'
$(INSTALL_DATA) ../../release/*.sql '$(DESTDIR)$(datadir)/extension/' $(INSTALL_DATA) ../../release/*.sql '$(DESTDIR)$(datadir)/extension/'
# TODO: install also upgrade/downgrade files (manually generated) # TODO: install also upgrade/downgrade files (manually generated)
virtualenv --system-site-packages $(VIRTUALENV_PATH)/$(EXTVERSION) virtualenv --system-site-packages $(VIRTUALENV_PATH)/$(RELEASE_VERSION)
$(VIRTUALENV_PATH)/$(EXTVERSION)/bin/pip install -I -U ../../release/python/$(EXTVERSION)/$(PACKAGE) $(VIRTUALENV_PATH)/$(RELEASE_VERSION)/bin/pip install -I -U ../../release/python/$(RELEASE_VERSION)/$(PACKAGE)
$(VIRTUALENV_PATH)/$(EXTVERSION)/bin/pip install -I nose $(VIRTUALENV_PATH)/$(RELEASE_VERSION)/bin/pip install -I nose
clean-dev: clean-dev:
rm -f $(EXTENSION)--*.sql rm -f $(EXTENSION)--*.sql