Skip to content

Commit

Permalink
Merge pull request #7 from crim-ca/doc-fix
Browse files Browse the repository at this point in the history
readme update + shields + bumpversion (ref issue #1)
  • Loading branch information
fmigneault committed Mar 7, 2019
2 parents 0f44dfd + 6fa699b commit b9890b6
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 49 deletions.
12 changes: 12 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[bumpversion]
current_version = 0.1.2
commit = True
tag = True

[bumpversion:file:README.rst]
search = {current_version}
replace = {new_version}

[bumpversion:file:weaver/__meta__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
92 changes: 66 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ CONDA_ENVS_DIR ?= $(HOME)/.conda/envs
CONDA_ENV_PATH := $(CONDA_ENVS_DIR)/$(CONDA_ENV)
CONDA_PINNED := $(APP_ROOT)/env/conda-pinned

# Docker
DOCKER_REPO := docker-registry.crim.ca/ogc/weaver

# Configuration used by update-config
HOSTNAME ?= localhost
HTTP_PORT ?= 8094
Expand Down Expand Up @@ -54,40 +57,45 @@ all: help
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " help print this help message. (Default)"
@echo " version print version number of this Makefile."
@echo " version print current project version number."
@echo " info print information about $(APP_NAME)."
@echo "\nInstallation:"
@echo "Installation:"
@echo " install install $(APP_NAME) by running 'bin/buildout -c custom.cfg'."
@echo " install-base install base packages using pip."
@echo " install-dev install test packages using pip (also installs $(APP_NAME) with buildout)."
@echo " install-pip install as a package to allow import in another python code."
@echo " install-raw install without any requirements or dependencies (suppose everything is setup)."
@echo " install-sys install system packages from requirements.sh."
@echo " update update application by running 'bin/buildout -o -c custom.cfg' (buildout offline mode)."
@echo "\nCleaning:"
@echo "Build and deploy:"
@echo " bump bump version using version specified as user input"
@echo " bump-dry bump version using version specified as user input (dry-run)"
@echo " bump-tag bump version using version specified as user input, tags it and commits change in git"
@echo " docker-info detail about version of docker image to be tagged for build/push"
@echo " docker-build build docker image"
@echo " docker-push push built docker image"
@echo "Cleaning:"
@echo " clean delete all files that are created by running buildout."
@echo " clean-bld remove the temporary build files."
@echo " clean-cache remove caches such as DOWNLOAD_CACHE."
@echo " clean-env remove the conda enviroment $(CONDA_ENV)."
@echo " clean-src remove all *.pyc files."
@echo " clean-dist remove *all* files that are not controlled by 'git'."
@echo " [WARNING: use it *only* if you know what you do!]"
@echo "\nTesting targets:"
@echo "Testing targets:"
@echo " test run tests (but skip long running and online tests)."
@echo " test-func run funtional tests (online and usage specific)."
@echo " test-all run all tests (including long running tests)."
@echo " coverage run all tests using coverage analysis."
@echo " pep8 run pep8 code style checks."
@echo "\nSphinx targets:"
@echo "Sphinx targets:"
@echo " docs generate HTML documentation with Sphinx."
@echo " linkcheck check all external links in documentation for integrity."
@echo " doc8 run doc8 documentation style checks."
@echo "\nSupporting targets:"
@echo " passwd generate password for 'phoenix-password' in custom.cfg."
@echo "Supporting targets:"
@echo " conda-env-export export the conda environment."
@echo " [CAUTION! You always need to check if the enviroment.yml is working.]"
@echo " selfupdate update this Makefile."
@echo "\nSupervisor targets:"
@echo "Supervisor targets:"
@echo " start start supervisor service."
@echo " stop stop supervisor service."
@echo " restart restart supervisor service."
Expand All @@ -103,12 +111,13 @@ info:
@echo "Informations about your Bird:"
@echo " OS_NAME $(OS_NAME)"
@echo " CPU_ARCH $(CPU_ARCH)"
@echo " Anaconda Home $(CONDA_HOME)"
@echo " Conda Environment $(CONDA_ENV). Use \`source activate $(CONDA_ENV)' to activate it."
@echo " Conda Home $(CONDA_HOME)"
@echo " Conda Environment $(CONDA_ENV)."
@echo " Conda Prefix $(CONDA_ENV_PATH)"
@echo " APP_NAME $(APP_NAME)"
@echo " APP_ROOT $(APP_ROOT)"
@echo " DOWNLOAD_CACHE $(DOWNLOAD_CACHE)"
@echo " DOCKER_REPO $(DOCKER_REPO)"

## Helper targets ... ensure that Makefile etc are in place

Expand Down Expand Up @@ -266,6 +275,8 @@ online-update-config:
settings:hostname=$(HOSTNAME) settings:output-port=$(OUTPUT_PORT) \
settings:http-port=$(HTTP_PORT) -N -c custom.cfg"

## Cleanup targets

.PHONY: clean
clean: clean-bld clean-cache clean-src
@echo "Cleaning buildout files ..."
Expand Down Expand Up @@ -304,17 +315,7 @@ clean-dist: backup clean
@git diff --quiet HEAD || echo "There are uncommited changes! Not doing 'git clean' ..."
@-git clean -dfx -e *.bak -e custom.cfg -e Makefile.config

.PHONY: passwd
passwd: custom.cfg
@echo "Generate Phoenix password ..."
@echo "Enter a password with at least 8 characters."
@bash -c "source $(CONDA_HOME)/bin/activate $(CONDA_ENV); \
python -c 'from IPython.lib import passwd; pw = passwd(algorithm=\"sha256\"); \
lines = [\"phoenix-password = \" + pw + \"\\n\" if line.startswith(\"phoenix-password\") \
else line for line in open(\"custom.cfg\", \"r\")]; file = open(\"custom.cfg\", \"w\"); \
file.writelines(lines); file.close()'"
@echo ""
@echo "Run \`make install restart' to activate this password."
## Testing targets

.PHONY: test
test:
Expand Down Expand Up @@ -347,6 +348,8 @@ pep8:
@echo "Running pep8 code style checks ..."
$(CONDA_ENV_PATH)/bin/flake8

## Documentation targets

.PHONY: docs
docs:
@echo "Generating docs with Sphinx ..."
Expand All @@ -363,10 +366,47 @@ doc8:
@echo "Running doc8 doc style checks ..."
$(CONDA_ENV_PATH)/bin/doc8 docs/

.PHONY: selfupdate
selfupdate: bootstrap.sh .gitignore
@curl "https://raw.githubusercontent.com/bird-house/birdhousebuilder.bootstrap/$(RELEASE)/Makefile" \
--silent --insecure --output Makefile
## Bumpversion targets

.PHONY: bump
bump:
$(shell bash -c 'read -p "Version: " VERSION_PART; \
source "$(CONDA_HOME)/bin/activate" "$(CONDA_ENV)"; \
test -f "$(CONDA_ENV_PATH)/bin/bumpversion" || pip install bumpversion; \
"$(CONDA_ENV_PATH)/bin/bumpversion" --config-file "$(CUR_DIR)/.bumpversion.cfg" \
--verbose --allow-dirty --no-tag --new-version $$VERSION_PART patch;')

.PHONY: bump-dry
bump-dry:
$(shell bash -c 'read -p "Version: " VERSION_PART; \
source "$(CONDA_HOME)/bin/activate" "$(CONDA_ENV)"; \
test -f "$(CONDA_ENV_PATH)/bin/bumpversion" || pip install bumpversion; \
"$(CONDA_ENV_PATH)/bin/bumpversion" --config-file "$(CUR_DIR)/.bumpversion.cfg" \
--verbose --allow-dirty --dry-run --tag --tag-name "{new_version}" --new-version $$VERSION_PART patch;')

.PHONY: bump-tag
bump-tag:
$(shell bash -c 'read -p "Version: " VERSION_PART; \
source "$(CONDA_HOME)/bin/activate" "$(CONDA_ENV)"; \
test -f $(CONDA_ENV_PATH)/bin/bumpversion || pip install bumpversion; \
"$(CONDA_ENV_PATH)/bin/bumpversion" --config-file "$(CUR_DIR)/.bumpversion.cfg" \
--verbose --allow-dirty --tag --tag-name "{new_version}" --new-version $$VERSION_PART patch;')

## Docker targets

.PHONY: docker-info
docker-info:
@echo "Will be built, tagged and pushed as:"
@echo "$(DOCKER_REPO):`python -c 'from magpie.__meta__ import __version__; print(__version__)'`"

.PHONY: docker-build
docker-build:
@bash -c "docker build $(CUR_DIR) \
-t $(DOCKER_REPO):`python -c 'from magpie.__meta__ import __version__; print(__version__)'`"

.PHONY: docker-push
docker-push: docker-build
@bash -c "docker push $(DOCKER_REPO):`python -c 'from magpie.__meta__ import __version__; print(__version__)'`"

## Supervisor targets

Expand Down
84 changes: 62 additions & 22 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,6 @@
Weaver: workflow execution management service
=============================================

.. # TODO: adjust references
.. image:: https://img.shields.io/badge/docs-latest-brightgreen.svg
:target: http://weaver.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://travis-ci.org/bird-house/weaver.svg?branch=master
:target: https://travis-ci.org/bird-house/weaver
:alt: Travis Build

.. image:: https://img.shields.io/github/license/bird-house/weaver.svg
:target: https://github.com/bird-house/weaver/blob/master/LICENSE.txt
:alt: GitHub license

.. image:: https://badges.gitter.im/bird-house/birdhouse.svg
:target: https://gitter.im/bird-house/birdhouse?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
:alt: Join the chat at https://gitter.im/bird-house/birdhouse


Weaver (the nest-builder)
*Weaver birds build exquisite and elaborate nest structures that are a rival to any human feat of engineering.
Some of these nests are the largest structures to be built by birds.*
Expand All @@ -34,13 +15,72 @@ application and `Web Processing Services (WPS)` inputs and outputs. It allows us
`Application Deployment and Execution Services (ADES)` to dispatch application executions as defined by
`Common Workflow Language (CWL)` configuration.

.. start-badges
.. list-table::
:stub-columns: 1

* - dependencies
- | |py_ver| |requires|
* - build status
- | |travis_latest| |travis_tag| |coverage|
* - releases
- | |version| |commits-since| |license|

.. |py_ver| image:: https://img.shields.io/badge/python-2.7%2C%203.5%2B-blue.svg
:alt: Requires Python 2.7, 3.5+
:target: https://www.python.org/getit

.. |commits-since| image:: https://img.shields.io/github/commits-since/crim-ca/weaver/0.1.2.svg
:alt: Commits since latest release
:target: https://github.com/crim-ca/weaver/compare/v0.1.2...master

.. |version| image:: https://img.shields.io/github/tag/crim-ca/weaver.svg?style=flat
:alt: Latest Tag
:target: https://github.com/crim-ca/weaver/tree/0.1.2

.. |requires| image:: https://requires.io/github/crim-ca/weaver/requirements.svg?branch=master
:alt: Requirements Status
:target: https://requires.io/github/crim-ca/weaver/requirements/?branch=master

.. |travis_latest| image:: https://img.shields.io/travis/com/crim-ca/weaver/master.svg?label=master
:alt: Travis-CI Build Status (master branch)
:target: https://travis-ci.com/crim-ca/weaver

.. |travis_tag| image:: https://img.shields.io/travis/com/crim-ca/weaver/0.1.2.svg?label=0.1.2
:alt: Travis-CI Build Status (latest tag)
:target: https://github.com/crim-ca/weaver/tree/0.1.2

.. |coverage| image:: https://img.shields.io/codecov/c/gh/crim-ca/weaver.svg?label=coverage
:alt: Travis-CI CodeCov Coverage
:target: https://codecov.io/gh/crim-ca/weaver

.. |license| image:: https://img.shields.io/github/license/crim-ca/weaver.svg
:target: https://github.com/crim-ca/weaver/blob/master/LICENSE.txt
:alt: GitHub license

.. end-badges
----------------
Links
----------------

Docker image `repository <https://docker-registry.crim.ca/repositories/3463>`_.

::

$ docker pull docker-registry.crim.ca/ogc/weaver:0.1.2

Test server: https://ogc-ems.crim.ca/weaver/

----------------
Extra Details
----------------

The project is developed and based of `OGC Testbed-14 – ESA Sponsored Threads – Exploitation Platform` findings and
following improvements.

`Weaver` is a **prototype** implemented in Python with the `Pyramid`_ web framework.

`Weaver` is part of the `Birdhouse`_ project.

.. _Birdhouse: http://birdhouse.readthedocs.io/en/latest/
.. _Pyramid: http://www.pylonsproject.org
.. _PAVICS: https://ouranosinc.github.io/pavics-sdi/index.html
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Check the status of the weaver service:
Supervisor status ...
mongodb RUNNING pid 6863, uptime 0:00:19
nginx RUNNING pid 6865, uptime 0:00:19
weaver RUNNING pid 6864, uptime 0:00:19
weaver RUNNING pid 6864, uptime 0:00:19
You will find more information about the installation in the `Makefile documentation`_.
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bumpversion
coverage
flake8
mock
Expand Down

0 comments on commit b9890b6

Please sign in to comment.