A docker deployment tool built in python. It is based on fabric and uses docker-compose to orchestrate and manage containers. You can use it to build images, push images and trigger updates on remote machines.
To install Skeppa you need Python 2.7, docker and docker-compose.
pip install skeppa
pip install git+git://github.com/marteinn/skeppa.git@develop
First off, head to your project and install skeppa: pip install skeppa
.
Time to setup deployment instructions. This simple example below build a image called app, push it to a registry, then deploy on remote machine using the docker-compose file.
-
touch skeppa.yaml
-
In your skeppa.yaml, add the following:
prod: project: test-project hosts: ssh.yourhost.com user: ssh-user path: /home/youruser/yourproject/ key_filename: ~/.ssh/id_rsa.pub image: name: app path: app repository: url: registry.mydomain.com/app-image compose_files: docker-compose.yml
(This example requires docker image called
app
in your project folder, a working docker repository and a workingdocker-compose.yml
).Want a full annotated skeppa.yaml?
-
Then run
skeppa prod setup
, this will uploaddocker-compose.yml
to your prod path. -
Time to build a docker image of your app
skeppa prod build
-
Now send the image you just built to your registry
skeppa prod push
-
Finally type
skeppa prod deploy
to deploy the image on your remote machine and create running containers. -
Done!
Want more examples?
-
How can I supply env-variables to skeppa?
- Since skappa is based on fabric just add
-c yourfile.env
when running your command. Skeppa will by default try load either skeppa.env, fabricrc.txt or .fabricrc from your cwd.
- Since skappa is based on fabric just add
-
How can I include env-variables in my
skeppa.yaml
?- Just define your variables like this
{{ MY_VAR }}
. Example:host: {{ HOST }}
.
- Just define your variables like this
-
Can I define my own custom
skeppa.yaml
, such asskeppa-prod.yaml
?- Sure! Add the argument
-skeppaconfig
in your command, like this:skeppa prod ping -skeppaconfig skeppa-prod.yaml
- Sure! Add the argument
The tool consists of 4 commands, they can run in conjunction with eachother.
Command | Description | Example |
---|---|---|
setup | Initializes you application by creating the necessary directories/files. Must run first | skeppa <environment> setup |
build | Builds docker images specified in config | skeppa <environment> build |
push | Pushes docker image to registry | skeppa <environment> push |
deploy | Pulls down docker image on remote and runs docker-compose up |
skeppa <environment> deploy |
The name is a wordplay with the swedish word for "to ship" = "skeppa".
These hooks will automatically bump the application version when using git flow release ...
ln -nfs $PWD/git-hooks/bump-version.sh .git/hooks/post-flow-release-start
ln -nfs $PWD/git-hooks/bump-version.sh .git/hooks/post-flow-hotfix-start
- Dynamic Fabric Commands For Managing Cloud Servers
- Class-based Fabric scripts via a Python metaprogramming hack
Want to contribute? Awesome. Just send a pull request.
Skeppa is released under the MIT License.