mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-18 03:23:37 +08:00
Cleanup Makefile targets, script names, and README
This commit is contained in:
parent
e419dbe621
commit
0ec5095cf5
35
Makefile
35
Makefile
@ -1,20 +1,28 @@
|
|||||||
|
|
||||||
TEST_IMAGE_NAME = iobeamdb-test
|
IMAGE_NAME = iobeamdb
|
||||||
TEST_CONTAINER_NAME = iobeamdb-test-container
|
|
||||||
|
|
||||||
MAKE = make
|
MAKE = make
|
||||||
|
|
||||||
all: test
|
all: test-docker
|
||||||
|
|
||||||
build-test-docker:
|
# Targets for installing the extension without using Docker
|
||||||
@docker build . -t $(TEST_IMAGE_NAME)
|
clean:
|
||||||
|
$(MAKE) -C ./extension clean
|
||||||
|
@rm -f ./extension/iobeamdb--*.sql
|
||||||
|
|
||||||
start-test-docker: stop-test-docker
|
install:
|
||||||
@IOBEAMDB_DOCKER_IMAGE=$(TEST_IMAGE_NAME) ./scripts/start-pg-docker.sh
|
$(MAKE) -C ./extension install
|
||||||
|
|
||||||
stop-test-docker:
|
# Targets for building/running Docker images
|
||||||
|
build-docker:
|
||||||
|
@docker build . -t $(IMAGE_NAME)
|
||||||
|
|
||||||
|
start-docker: stop-docker
|
||||||
|
@IOBEAMDB_DOCKER_IMAGE=$(IMAGE_NAME) ./scripts/start-docker.sh
|
||||||
|
|
||||||
|
stop-docker:
|
||||||
@docker rm -f iobeamdb || :
|
@docker rm -f iobeamdb || :
|
||||||
|
|
||||||
|
# Targets for tests
|
||||||
test-regression:
|
test-regression:
|
||||||
@cd extension/sql/tests/regression; ./run.sh
|
@cd extension/sql/tests/regression; ./run.sh
|
||||||
|
|
||||||
@ -24,9 +32,10 @@ test-unit:
|
|||||||
test-all: test-regression test-unit
|
test-all: test-regression test-unit
|
||||||
@echo Running all tests
|
@echo Running all tests
|
||||||
|
|
||||||
|
test-docker: build-docker start-docker test-all stop-docker
|
||||||
|
|
||||||
|
# Setting up a single node database
|
||||||
setup-single-node-db:
|
setup-single-node-db:
|
||||||
PGDATABASE=test ./scripts/run_sql.sh setup_single_node_db.psql
|
PGDATABASE=test ./scripts/run_sql.sh setup_single_node_db.psql
|
||||||
|
|
||||||
test: build-test-docker start-test-docker test-all stop-test-docker
|
.PHONY: build-docker start-docker stop-docker test-regression test-unit test-all test all setup-single-node-db
|
||||||
|
|
||||||
.PHONY: build-test-docker start-test-docker stop-test-docker test-regression test-unit test-all test all setup-single-node-db
|
|
||||||
|
37
README.md
37
README.md
@ -1,21 +1,26 @@
|
|||||||
### Running docker image
|
### Building and running in Docker
|
||||||
|
|
||||||
To start the database, simply:
|
The `Makefile` included in this repo has convenient commands for building,
|
||||||
|
starting, and stopping a Docker image of **iobeamdb**:
|
||||||
```bash
|
```bash
|
||||||
make start-pg-docker
|
# To build the image
|
||||||
```
|
make build-docker
|
||||||
This will allow you to run the tests. When finished,
|
# To start the image (will stop any running instances first)
|
||||||
```bash
|
make start-docker
|
||||||
make stop-pg-docker
|
# To stop the image
|
||||||
|
make stop-docker
|
||||||
```
|
```
|
||||||
|
|
||||||
### Initializing a single-node database
|
With the Docker image running you can run the tests (see Testing) or create
|
||||||
After setting up a docker image, you can start a local
|
your own single-node cluster.
|
||||||
single node database with the following command:
|
|
||||||
|
#### Initializing a single-node database
|
||||||
|
After starting the Docker image, you can start a local single node database:
|
||||||
```bash
|
```bash
|
||||||
make setup-single-node-db
|
make setup-single-node-db
|
||||||
```
|
```
|
||||||
This will set up a database named iobeam which can be accessed with:
|
|
||||||
|
This will set up a database named `iobeam` which can be accessed with:
|
||||||
```bash
|
```bash
|
||||||
psql -U postgres -h localhost -d iobeam
|
psql -U postgres -h localhost -d iobeam
|
||||||
```
|
```
|
||||||
@ -27,10 +32,14 @@ psql -U postgres -h localhost -d iobeam
|
|||||||
* [Querying With Ioql](extension/sql/tests/regression/query.sql)
|
* [Querying With Ioql](extension/sql/tests/regression/query.sql)
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
There are three commands to run tests: (1) all tests, (2) regression tests, and
|
There are four commands to run tests:
|
||||||
(3) unit tests. They are:
|
|
||||||
```bash
|
```bash
|
||||||
make test
|
# Build and run a docker image and run all tests in that image
|
||||||
|
make test-docker
|
||||||
|
# Run all tests (no image built)
|
||||||
|
make test-all
|
||||||
|
# Run regression tests (no image built)
|
||||||
make test-regression
|
make test-regression
|
||||||
|
# Run unit tests (no image built)
|
||||||
make test-unit
|
make test-unit
|
||||||
```
|
```
|
||||||
|
@ -35,4 +35,4 @@ package: clean all generate-sql-install-file
|
|||||||
$(install_sh) -m 644 iobeamdb.control 'package/extension/'
|
$(install_sh) -m 644 iobeamdb.control 'package/extension/'
|
||||||
$(install_sh) -m 644 iobeamdb--1.0.sql 'package/extension/'
|
$(install_sh) -m 644 iobeamdb--1.0.sql 'package/extension/'
|
||||||
|
|
||||||
.PHONY: check-sql-files generate-sql-install-file start-pg-docker stop-pg-docker test test-regression test-unit
|
.PHONY: check-sql-files generate-sql-install-file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user