Merge pull request #411 from Algunenano/parallel_deploy
PG release: Strip PARALLEL on deploy instead of release
This commit is contained in:
commit
f4d57007c2
@ -73,19 +73,28 @@ release: $(EXTENSION).control $(SOURCES_DATA)
|
|||||||
$(SED) $(REPLACEMENTS) $(EXTENSION).control
|
$(SED) $(REPLACEMENTS) $(EXTENSION).control
|
||||||
git add $(EXTENSION).control
|
git add $(EXTENSION).control
|
||||||
cat $(SOURCES_DATA_DIR)/*.sql > $(EXTENSION)--$(NEW_VERSION).sql
|
cat $(SOURCES_DATA_DIR)/*.sql > $(EXTENSION)--$(NEW_VERSION).sql
|
||||||
ifeq ($(PG_PARALLEL), 0)
|
|
||||||
# Remove PARALLEL in aggregates and functions
|
|
||||||
$(eval TMPFILE := $(shell mktemp /tmp/$(basename $0).XXXXXXXX))
|
|
||||||
$(SED) -e 's/PARALLEL \= [A-Z]*,/''/g' \
|
|
||||||
-e 's/PARALLEL [A-Z]*/''/g' $@ > $(TMPFILE)
|
|
||||||
mv $(TMPFILE) $@
|
|
||||||
endif
|
|
||||||
git add $(EXTENSION)--$(NEW_VERSION).sql
|
|
||||||
$(ERB) version=$(NEW_VERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql
|
$(ERB) version=$(NEW_VERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql
|
||||||
$(ERB) version=$(EXTVERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(NEW_VERSION)--$(EXTVERSION).sql
|
$(ERB) version=$(EXTVERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(NEW_VERSION)--$(EXTVERSION).sql
|
||||||
|
cat $(EXTENSION)--$(NEW_VERSION).sql >> $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql
|
||||||
|
git add $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql $(EXTENSION)--$(NEW_VERSION)--$(EXTVERSION).sql $(EXTENSION)--$(NEW_VERSION).sql
|
||||||
|
|
||||||
# Only meant for development time, do not use once a version is released
|
# Only meant for development time, do not use once a version is released
|
||||||
.PHONY: devclean
|
.PHONY: devclean
|
||||||
devclean:
|
devclean:
|
||||||
rm -f $(NEW_EXTENSION_ARTIFACT)
|
rm -f $(NEW_EXTENSION_ARTIFACT)
|
||||||
rm -f $(GENERATED_SQL_FILES)
|
rm -f $(GENERATED_SQL_FILES)
|
||||||
|
|
||||||
|
# If needed remove PARALLEL tags from the release files
|
||||||
|
release_remove_parallel_deploy:
|
||||||
|
ifeq ($(PG_PARALLEL), 0)
|
||||||
|
for n in $(wildcard old_versions/*.sql *.sql); do \
|
||||||
|
$(eval TMPFILE := $(shell mktemp /tmp/XXXXXXXXXX)) \
|
||||||
|
$(SED) -e 's/PARALLEL \= [A-Z]*,/''/g' -e 's/PARALLEL [A-Z]*/''/g' $$n > $(TMPFILE); \
|
||||||
|
mv $(TMPFILE) $$n; \
|
||||||
|
done
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Install the current release into the PostgreSQL extensions directory
|
||||||
|
deploy: release_remove_parallel_deploy
|
||||||
|
$(INSTALL_DATA) $(EXTENSION).control '$(DESTDIR)$(datadir)/extension/'
|
||||||
|
$(INSTALL_DATA) old_versions/*.sql *.sql '$(DESTDIR)$(datadir)/extension/'
|
||||||
|
@ -52,18 +52,29 @@ release: $(EXTENSION).control $(SOURCES_DATA)
|
|||||||
test -n "$(NEW_VERSION)" # $$NEW_VERSION VARIABLE MISSING. Eg. make release NEW_VERSION=0.x.0
|
test -n "$(NEW_VERSION)" # $$NEW_VERSION VARIABLE MISSING. Eg. make release NEW_VERSION=0.x.0
|
||||||
git mv *.sql old_versions
|
git mv *.sql old_versions
|
||||||
$(SED) $(REPLACEMENTS) $(EXTENSION).control
|
$(SED) $(REPLACEMENTS) $(EXTENSION).control
|
||||||
|
git add $(EXTENSION).control
|
||||||
cat $(SOURCES_DATA_DIR)/*.sql > $(EXTENSION)--$(NEW_VERSION).sql
|
cat $(SOURCES_DATA_DIR)/*.sql > $(EXTENSION)--$(NEW_VERSION).sql
|
||||||
ifeq ($(PG_PARALLEL), 0)
|
|
||||||
# Remove PARALLEL in aggregates and functions
|
|
||||||
$(eval TMPFILE := $(shell mktemp /tmp/$(basename $0).XXXXXXXX))
|
|
||||||
$(SED) -e 's/PARALLEL \= [A-Z]*,/''/g' \
|
|
||||||
-e 's/PARALLEL [A-Z]*/''/g' $@ > $(TMPFILE)
|
|
||||||
mv $(TMPFILE) $@
|
|
||||||
endif
|
|
||||||
$(ERB) version=$(NEW_VERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql
|
$(ERB) version=$(NEW_VERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql
|
||||||
$(ERB) version=$(EXTVERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(NEW_VERSION)--$(EXTVERSION).sql
|
$(ERB) version=$(EXTVERSION) upgrade_downgrade_template.erb > $(EXTENSION)--$(NEW_VERSION)--$(EXTVERSION).sql
|
||||||
|
cat $(EXTENSION)--$(NEW_VERSION).sql >> $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql
|
||||||
|
git add $(EXTENSION)--$(EXTVERSION)--$(NEW_VERSION).sql $(EXTENSION)--$(NEW_VERSION)--$(EXTVERSION).sql $(EXTENSION)--$(NEW_VERSION).sql
|
||||||
|
|
||||||
# Only meant for development time, do not use once a version is released
|
# Only meant for development time, do not use once a version is released
|
||||||
.PHONY: devclean
|
.PHONY: devclean
|
||||||
devclean:
|
devclean:
|
||||||
rm -f $(NEW_EXTENSION_ARTIFACT)
|
rm -f $(NEW_EXTENSION_ARTIFACT)
|
||||||
|
|
||||||
|
# If needed remove PARALLEL tags from the release files
|
||||||
|
release_remove_parallel_deploy:
|
||||||
|
ifeq ($(PG_PARALLEL), 1)
|
||||||
|
for n in $(wildcard old_versions/*.sql *.sql); do \
|
||||||
|
$(eval TMPFILE := $(shell mktemp /tmp/XXXXXXXXXX)) \
|
||||||
|
$(SED) -e 's/PARALLEL \= [A-Z]*,/''/g' -e 's/PARALLEL [A-Z]*/''/g' $$n > $(TMPFILE); \
|
||||||
|
mv $(TMPFILE) $$n; \
|
||||||
|
done
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Install the current release into the PostgreSQL extensions directory
|
||||||
|
deploy: release_remove_parallel_deploy
|
||||||
|
$(INSTALL_DATA) $(EXTENSION).control '$(DESTDIR)$(datadir)/extension/'
|
||||||
|
$(INSTALL_DATA) old_versions/*.sql *.sql '$(DESTDIR)$(datadir)/extension/'
|
||||||
|
Loading…
Reference in New Issue
Block a user