mirror of
https://github.com/planetmint/planetmint.git
synced 2025-06-07 14:46:38 +00:00
Merge branch 'main' into integration-test
This commit is contained in:
commit
85ed0befcf
@ -1,7 +1,7 @@
|
|||||||
FROM alpine:3.9
|
FROM alpine:3.9
|
||||||
LABEL maintainer "contact@ipdb.global"
|
LABEL maintainer "contact@ipdb.global"
|
||||||
|
|
||||||
ARG TM_VERSION=v0.34.11
|
ARG TM_VERSION=v0.34.15
|
||||||
RUN mkdir -p /usr/src/app
|
RUN mkdir -p /usr/src/app
|
||||||
ENV HOME /root
|
ENV HOME /root
|
||||||
COPY . /usr/src/app/
|
COPY . /usr/src/app/
|
||||||
|
33
Makefile
33
Makefile
@ -1,4 +1,4 @@
|
|||||||
.PHONY: help run start stop logs test test-unit test-unit-watch test-acceptance test-integration cov doc doc-acceptance clean reset release dist check-deps clean-build clean-pyc clean-test
|
.PHONY: help run start stop logs lint test test-unit test-unit-watch test-acceptance test-integration cov docs docs-acceptance clean reset release dist check-deps clean-build clean-pyc clean-test
|
||||||
|
|
||||||
.DEFAULT_GOAL := help
|
.DEFAULT_GOAL := help
|
||||||
|
|
||||||
@ -70,6 +70,9 @@ stop: check-deps ## Stop Planetmint
|
|||||||
logs: check-deps ## Attach to the logs
|
logs: check-deps ## Attach to the logs
|
||||||
@$(DC) logs -f planetmint
|
@$(DC) logs -f planetmint
|
||||||
|
|
||||||
|
lint: check-deps ## Lint the project
|
||||||
|
@$(DC) up lint
|
||||||
|
|
||||||
test: check-deps test-unit test-acceptance ## Run unit and acceptance tests
|
test: check-deps test-unit test-acceptance ## Run unit and acceptance tests
|
||||||
|
|
||||||
test-unit: check-deps ## Run all tests once
|
test-unit: check-deps ## Run all tests once
|
||||||
@ -89,17 +92,16 @@ cov: check-deps ## Check code coverage and open the result in the browser
|
|||||||
@$(DC) run --rm planetmint pytest -v --cov=planetmint --cov-report html
|
@$(DC) run --rm planetmint pytest -v --cov=planetmint --cov-report html
|
||||||
$(BROWSER) htmlcov/index.html
|
$(BROWSER) htmlcov/index.html
|
||||||
|
|
||||||
doc: check-deps ## Generate HTML documentation and open it in the browser
|
docs: check-deps ## Generate HTML documentation and open it in the browser
|
||||||
@$(DC) run --rm --no-deps bdocs make -C docs/root html
|
@$(DC) run --rm --no-deps bdocs make -C docs/root html
|
||||||
@$(DC) run --rm --no-deps bdocs make -C docs/server html
|
|
||||||
@$(DC) run --rm --no-deps bdocs make -C docs/contributing html
|
|
||||||
$(BROWSER) docs/root/build/html/index.html
|
$(BROWSER) docs/root/build/html/index.html
|
||||||
|
|
||||||
doc-acceptance: check-deps ## Create documentation for acceptance tests
|
docs-acceptance: check-deps ## Create documentation for acceptance tests
|
||||||
@$(DC) run --rm python-acceptance pycco -i -s /src -d /docs
|
@$(DC) run --rm python-acceptance pycco -i -s /src -d /docs
|
||||||
$(BROWSER) acceptance/python/docs/index.html
|
$(BROWSER) acceptance/python/docs/index.html
|
||||||
|
|
||||||
clean: clean-build clean-pyc clean-test ## Remove all build, test, coverage and Python artifacts
|
clean: check-deps ## Remove all build, test, coverage and Python artifacts
|
||||||
|
@$(DC) up clean
|
||||||
@$(ECHO) "Cleaning was successful."
|
@$(ECHO) "Cleaning was successful."
|
||||||
|
|
||||||
reset: check-deps ## Stop and REMOVE all containers. WARNING: you will LOSE all data stored in Planetmint.
|
reset: check-deps ## Stop and REMOVE all containers. WARNING: you will LOSE all data stored in Planetmint.
|
||||||
@ -126,22 +128,3 @@ ifndef IS_DOCKER_COMPOSE_INSTALLED
|
|||||||
@$(ECHO)
|
@$(ECHO)
|
||||||
@$(DC) # docker-compose is not installed, so we call it to generate an error and exit
|
@$(DC) # docker-compose is not installed, so we call it to generate an error and exit
|
||||||
endif
|
endif
|
||||||
|
|
||||||
clean-build: # Remove build artifacts
|
|
||||||
@rm -fr build/
|
|
||||||
@rm -fr dist/
|
|
||||||
@rm -fr .eggs/
|
|
||||||
@find . -name '*.egg-info' -exec rm -fr {} +
|
|
||||||
@find . -name '*.egg' -exec rm -f {} +
|
|
||||||
|
|
||||||
clean-pyc: # Remove Python file artifacts
|
|
||||||
@find . -name '*.pyc' -exec rm -f {} +
|
|
||||||
@find . -name '*.pyo' -exec rm -f {} +
|
|
||||||
@find . -name '*~' -exec rm -f {} +
|
|
||||||
@find . -name '__pycache__' -exec rm -fr {} +
|
|
||||||
|
|
||||||
clean-test: # Remove test and coverage artifacts
|
|
||||||
@find . -name '.pytest_cache' -exec rm -fr {} +
|
|
||||||
@rm -fr .tox/
|
|
||||||
@rm -f .coverage
|
|
||||||
@rm -fr htmlcov/
|
|
||||||
|
@ -43,10 +43,11 @@ There are also other commands you can execute:
|
|||||||
* `make start`: Run Planetmint from source and daemonize it (stop it with `make stop`).
|
* `make start`: Run Planetmint from source and daemonize it (stop it with `make stop`).
|
||||||
* `make stop`: Stop Planetmint.
|
* `make stop`: Stop Planetmint.
|
||||||
* `make logs`: Attach to the logs.
|
* `make logs`: Attach to the logs.
|
||||||
|
* `make lint`: Lint the project
|
||||||
* `make test`: Run all unit and acceptance tests.
|
* `make test`: Run all unit and acceptance tests.
|
||||||
* `make test-unit-watch`: Run all tests and wait. Every time you change code, tests will be run again.
|
* `make test-unit-watch`: Run all tests and wait. Every time you change code, tests will be run again.
|
||||||
* `make cov`: Check code coverage and open the result in the browser.
|
* `make cov`: Check code coverage and open the result in the browser.
|
||||||
* `make doc`: Generate HTML documentation and open it in the browser.
|
* `make docs`: Generate HTML documentation and open it in the browser.
|
||||||
* `make clean`: Remove all build, test, coverage and Python artifacts.
|
* `make clean`: Remove all build, test, coverage and Python artifacts.
|
||||||
* `make reset`: Stop and REMOVE all containers. WARNING: you will LOSE all data stored in Planetmint.
|
* `make reset`: Stop and REMOVE all containers. WARNING: you will LOSE all data stored in Planetmint.
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ services:
|
|||||||
command: '.ci/entrypoint.sh'
|
command: '.ci/entrypoint.sh'
|
||||||
restart: always
|
restart: always
|
||||||
tendermint:
|
tendermint:
|
||||||
image: tendermint/tendermint:v0.34.11
|
image: tendermint/tendermint:v0.34.15
|
||||||
# volumes:
|
# volumes:
|
||||||
# - ./tmdata:/tendermint
|
# - ./tmdata:/tendermint
|
||||||
entrypoint: ''
|
entrypoint: ''
|
||||||
@ -114,3 +114,20 @@ services:
|
|||||||
- '33333:80'
|
- '33333:80'
|
||||||
volumes:
|
volumes:
|
||||||
- ./docs/root/build/html:/usr/share/nginx/html
|
- ./docs/root/build/html:/usr/share/nginx/html
|
||||||
|
|
||||||
|
# Lints project according to PEP8
|
||||||
|
lint:
|
||||||
|
image: alpine/flake8
|
||||||
|
command: --max-line-length 119 /planetmint /acceptance /integration /tests
|
||||||
|
volumes:
|
||||||
|
- ./planetmint:/planetmint
|
||||||
|
- ./acceptance:/acceptance
|
||||||
|
- ./integration:/integration
|
||||||
|
- ./tests:/tests
|
||||||
|
|
||||||
|
# Remove all build, test, coverage and Python artifacts
|
||||||
|
clean:
|
||||||
|
image: alpine
|
||||||
|
command: /bin/sh -c "./planetmint/scripts/clean.sh"
|
||||||
|
volumes:
|
||||||
|
- $PWD:/planetmint
|
@ -30,9 +30,9 @@ The version of Planetmint Server described in these docs only works well with Te
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ sudo apt install -y unzip
|
$ sudo apt install -y unzip
|
||||||
$ wget https://github.com/tendermint/tendermint/releases/download/v0.34.11/tendermint_v0.34.11_linux_amd64.zip
|
$ wget https://github.com/tendermint/tendermint/releases/download/v0.34.15/tendermint_v0.34.15_linux_amd64.zip
|
||||||
$ unzip tendermint_v0.34.11_linux_amd64.zip
|
$ unzip tendermint_v0.34.15_linux_amd64.zip
|
||||||
$ rm tendermint_v0.34.11_linux_amd64.zip
|
$ rm tendermint_v0.34.15_linux_amd64.zip
|
||||||
$ sudo mv tendermint /usr/local/bin
|
$ sudo mv tendermint /usr/local/bin
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ you can do this:
|
|||||||
.. code::
|
.. code::
|
||||||
|
|
||||||
$ mkdir $(pwd)/tmdata
|
$ mkdir $(pwd)/tmdata
|
||||||
$ docker run --rm -v $(pwd)/tmdata:/tendermint/config tendermint/tendermint:v0.34.11 init
|
$ docker run --rm -v $(pwd)/tmdata:/tendermint/config tendermint/tendermint:v0.34.15 init
|
||||||
$ cat $(pwd)/tmdata/genesis.json
|
$ cat $(pwd)/tmdata/genesis.json
|
||||||
|
|
||||||
You should see something that looks like:
|
You should see something that looks like:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM tendermint/tendermint:v0.34.11
|
FROM tendermint/tendermint:v0.34.15
|
||||||
LABEL maintainer "contact@ipdb.global"
|
LABEL maintainer "contact@ipdb.global"
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
USER root
|
USER root
|
||||||
|
@ -17,7 +17,7 @@ stack_size=${STACK_SIZE:=4}
|
|||||||
stack_type=${STACK_TYPE:="docker"}
|
stack_type=${STACK_TYPE:="docker"}
|
||||||
stack_type_provider=${STACK_TYPE_PROVIDER:=""}
|
stack_type_provider=${STACK_TYPE_PROVIDER:=""}
|
||||||
# NOTE versions prior v0.28.0 have different priv_validator format!
|
# NOTE versions prior v0.28.0 have different priv_validator format!
|
||||||
tm_version=${TM_VERSION:="v0.34.11"}
|
tm_version=${TM_VERSION:="v0.34.15"}
|
||||||
mongo_version=${MONGO_VERSION:="3.6"}
|
mongo_version=${MONGO_VERSION:="3.6"}
|
||||||
stack_vm_memory=${STACK_VM_MEMORY:=2048}
|
stack_vm_memory=${STACK_VM_MEMORY:=2048}
|
||||||
stack_vm_cpus=${STACK_VM_CPUS:=2}
|
stack_vm_cpus=${STACK_VM_CPUS:=2}
|
||||||
|
@ -71,7 +71,7 @@ config = {
|
|||||||
'tendermint': {
|
'tendermint': {
|
||||||
'host': 'localhost',
|
'host': 'localhost',
|
||||||
'port': 26657,
|
'port': 26657,
|
||||||
'version': 'v0.34.11', # look for __tm_supported_versions__
|
'version': 'v0.34.15', # look for __tm_supported_versions__
|
||||||
},
|
},
|
||||||
# FIXME: hardcoding to localmongodb for now
|
# FIXME: hardcoding to localmongodb for now
|
||||||
'database': _database_map['localmongodb'],
|
'database': _database_map['localmongodb'],
|
||||||
|
@ -7,4 +7,4 @@ __version__ = '0.9.0'
|
|||||||
__short_version__ = '0.9'
|
__short_version__ = '0.9'
|
||||||
|
|
||||||
# Supported Tendermint versions
|
# Supported Tendermint versions
|
||||||
__tm_supported_versions__ = ["0.34.11"]
|
__tm_supported_versions__ = ["0.34.15"]
|
||||||
|
26
scripts/clean.sh
Executable file
26
scripts/clean.sh
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Copyright © 2020 Interplanetary Database Association e.V.,
|
||||||
|
# Planetmint and IPDB software contributors.
|
||||||
|
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
|
||||||
|
# Code is Apache-2.0 and docs are CC-BY-4.0
|
||||||
|
|
||||||
|
cd planetmint
|
||||||
|
|
||||||
|
# Remove build artifacts
|
||||||
|
rm -fr build/
|
||||||
|
rm -fr dist/
|
||||||
|
rm -fr .eggs/
|
||||||
|
find . -name '*.egg-info' -exec rm -fr {} +
|
||||||
|
find . -name '*.egg' -type f -exec rm -f {} +
|
||||||
|
|
||||||
|
# Remove Python file artifacts
|
||||||
|
find . -name '*.pyc' -exec rm -f {} +
|
||||||
|
find . -name '*.pyo' -exec rm -f {} +
|
||||||
|
find . -name '*~' -exec rm -f {} +
|
||||||
|
find . -name '__pycache__' -exec rm -fr {} +
|
||||||
|
|
||||||
|
# Remove test and coverage artifacts
|
||||||
|
find . -name '.pytest_cache' -exec rm -fr {} +
|
||||||
|
rm -fr .tox/
|
||||||
|
rm -f .coverage
|
||||||
|
rm -fr htmlcov/
|
@ -221,7 +221,7 @@ def test_autoconfigure_read_both_from_file_and_env(monkeypatch, request):
|
|||||||
'tendermint': {
|
'tendermint': {
|
||||||
'host': 'localhost',
|
'host': 'localhost',
|
||||||
'port': 26657,
|
'port': 26657,
|
||||||
'version': 'v0.34.11'
|
'version': 'v0.34.15'
|
||||||
},
|
},
|
||||||
'log': {
|
'log': {
|
||||||
'file': LOG_FILE,
|
'file': LOG_FILE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user