mirror of
https://github.com/CartoDB/crankshaft.git
synced 2024-11-01 10:20:48 +08:00
Add per-version subdirectories to the structure
This commit is contained in:
parent
77086a1ec4
commit
c4df227258
2
TODO.md
2
TODO.md
@ -1,6 +1,6 @@
|
||||
### Complete the structure:
|
||||
|
||||
* Support versioning
|
||||
* [x] Support versioning
|
||||
* Test use of `pgpy` from python Package
|
||||
* Add integration tests
|
||||
* Add `pysal` dependency and wrapper
|
||||
|
26
pg/Makefile
26
pg/Makefile
@ -1,20 +1,36 @@
|
||||
# Makefile to generate the extension out of separate sql source files.
|
||||
# Once a version is released, it is not meant to be changed. E.g: once version 0.0.1 is out, it SHALL NOT be changed.
|
||||
|
||||
EXTENSION = crankshaft
|
||||
EXTVERSION = $(shell grep default_version $(EXTENSION).control | sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
|
||||
|
||||
DATA = dist/$(EXTENSION)--$(EXTVERSION).sql
|
||||
# The new version to be generated from templates
|
||||
NEW_EXTENSION_ARTIFACT = dist/$(EXTENSION)--$(EXTVERSION).sql
|
||||
|
||||
SOURCES_DATA_DIR = sql
|
||||
# DATA is a special variable used by postgres build infrastructure
|
||||
# These are the files to be installed in the server shared dir,
|
||||
# for installation from scratch, upgrades and downgrades.
|
||||
# @see http://www.postgresql.org/docs/current/static/extend-pgxs.html
|
||||
DATA = $(NEW_EXTENSION_ARTIFACT)
|
||||
|
||||
SOURCES_DATA_DIR = sql/$(EXTVERSION)
|
||||
SOURCES_DATA = $(wildcard sql/$(EXTVERSION)/*.sql)
|
||||
|
||||
dist/$(EXTENSION)--$(EXTVERSION).sql: $(SOURCES_DATA)
|
||||
# The extension installation artifacts are stored in the dist subdirectory
|
||||
$(NEW_EXTENSION_ARTIFACT): $(SOURCES_DATA)
|
||||
rm -f $@
|
||||
cat $(SOURCES_DATA_DIR)/*.sql >> $@
|
||||
|
||||
# The PGXS build infraestructure takes the control file from this
|
||||
# directory, but for consistency we will copy the control file to
|
||||
# the dist subdirectory too.
|
||||
dist/$(EXTENSION).control: $(EXTENSION).control
|
||||
cp $< $@
|
||||
|
||||
REGRESS = $(notdir $(basename $(wildcard test/sql/*test.sql)))
|
||||
TEST_DIR = test
|
||||
all: dist/$(EXTENSION).control
|
||||
|
||||
REGRESS = $(notdir $(basename $(wildcard test/$(EXTVERSION)/sql/*test.sql)))
|
||||
TEST_DIR = test/$(EXTVERSION)
|
||||
REGRESS_OPTS = --inputdir='$(TEST_DIR)' --outputdir='$(TEST_DIR)'
|
||||
|
||||
PG_CONFIG = pg_config
|
||||
|
4
pg/test/0.0.1/results/01_install_test.out
Normal file
4
pg/test/0.0.1/results/01_install_test.out
Normal file
@ -0,0 +1,4 @@
|
||||
-- Install dependencies
|
||||
CREATE EXTENSION plpythonu;
|
||||
-- Install the extension
|
||||
CREATE EXTENSION crankshaft;
|
6
pg/test/0.0.1/results/02_poc_xyz_test.out
Normal file
6
pg/test/0.0.1/results/02_poc_xyz_test.out
Normal file
@ -0,0 +1,6 @@
|
||||
SELECT cdb_crankshaft.cdb_poc_xyz();
|
||||
cdb_poc_xyz
|
||||
-------------
|
||||
xyz-result
|
||||
(1 row)
|
||||
|
Loading…
Reference in New Issue
Block a user