This cookiecutter template adds a development and CI environment to an existing project. The cookiecutter-devenv template generates devbox
, make
, and CI
configuration.
Repository | https://bitbucket.org/greenguavalabs/cookiecutter-devenv | |
Pre-requisites | Local install: | |
make | ||
Docker and Docker Compose | ||
Local or remote install: | ||
Concourse CI |
Usage
You must render the template into a folder right under your project root for the generated scripts to work correctly. You get to choose the name of the folder. We recommend the name dev. To render the template follow the usage instructions.
The rendered file-tree will look like the following:
project Makefile dev env.mk concourse pipeline_promote.yml tasks unit_test.yml verify.yml docker docker-compose.yml devbox Dockerfile
The entire generated file tree should be commit to source control.
devbox
The devbox
is a Docker container used for compiling/running, testing and debugging the code. You get to chose the base container for the devbox
by specifying the programming language and version as a template parameter. The supported programming languages are: python and ruby. Additionally, the devbox
image contains the curl, wget, sudo, vim, iputils-pin
utilities, as well as a package manager for the selected language.
Furthermore, the project root folder is mounted inside the devbox
container under the path /src
. You can edit the source files on the host computer and any changes you make will be immediately visible inside the container.
To start the container execute the following commands:
cd dev/docker docker-compose up -d
Makefile
When rendering for python, the cookiecutter-devenv template configures the make
utility to run all development related tasks. You can run make
inside the devbox
container or on the host machine.
The Makefile
executes all commands inside the devbox
container via docker exec
unless the NO_DOCKER
environment variables is set. Therefore, you are able to run all tasks on the host machine without having the compilers or runtimes installed. Inside the devbox
container the NO_DOCKER
environment variable is set when the container is started.
CI
The cookiecutter-devenv template configures the promote Concourse CI pipeline. The pipeline merges the develop
branch into master
after successfully running all verification and test tasks.