A command line utility to deploy a stack on Docker Swarm.
- multi-environment
- env variables
- config template
Deploy the prod environment:
stackzou env prod deploy
Your project must contain these files:
/docker-compose.yml
: the Docker Compose file/envs/
: the directory where the environments are stored. Each subdirectory is considered an environment and must contain adocker-compose.override.yml
file with the values specific to its environment.
Your project can contain these files:
-
dotenv files are any file that ends with
.env
. They are read in this order:- at the root of the project
- inside a environment directory.
~/.secrets/containers/${STACK_NAME}.env
is read by stackzou.
The files
/envs/*/.stackzou.env
are reserved for Stackzou. -
/configs/
is the directory where the "Docker Configs" files are stored. Stackzou reads the content of this directory and creates a "Docker Config" with each file it finds. If the filename ends with.subst
, Stackzou attemps to render the file with theenvsubst
command.
Your project structure might looke like this:
./
├── configs/
│ ├── service1/
│ │ └── config.cfg
│ └── service2/
│ └── config.cfg
├── envs/
│ ├── local/
│ │ ├── docker-compose.override.yml
│ │ └── .env # le fichier doit finir par .env
│ ├── prod/
│ │ └── ... same
│ └── test/
│ └── ... same
├── .env
├── .gitignore
└── docker-compose.yml
$ cat .gitignore:
/envs/*/.stackzou.env
Requires the python3-dev
package.
make
You can clean with:
make clean-build clean-venv
or
make clean
make tests
make install
make doc
The generated doc is available at doc/index.html
.
- Freeze requirements
- test, tag and push
make clean build tests git tag ... git push && git push --tags
make requirements
export PYTHONPATH=$PWD
alias stackzou="$PWD/venv/python $PWD/stackzou/cli.py"