Go to file
2018-11-23 15:33:34 -05:00
deploy Added better error handling with more expresive messages 2018-11-23 15:33:34 -05:00
Dockerfile Remove file extension from scripts 2018-11-21 16:34:49 -05:00
LICENSE Add license 2018-11-21 15:12:03 -05:00
README.md Remove file extension from scripts 2018-11-21 16:34:49 -05:00
undeploy Added better error handling with more expresive messages 2018-11-23 15:33:34 -05:00

Portainer Stack Utils

Docker Automated build Docker Pulls Microbadger

Bash scripts to deploy/undeploy stacks in a Portainer instance from a docker-compose yaml file. Based on previous work by @vladbabii on docker-how-to/portainer-bash-scripts.

Supported Portainer API

Scripts were created for the latest Portainer API, which at the time of writing is 1.9.2.

Requirements

How to use

Two scripts are included: deploy and undeploy. Both scripts use the following environment variables to connect to the portainer instance:

  • PORTAINER_USER (string): Username
  • PORTAINER_PASSWORD (string): Password
  • PORTAINER_URL (string): URL to Portainer
  • PORTAINER_PRUNE ("true" or "false"): Whether to prune unused containers or not. Defaults to "false".
  • PORTAINER_ENDPOINT (int): Which endpoint to use. Defaults to 1.
  • HTTPIE_VERIFY_SSL ("yes" or "no"): Whether to verify SSL certificate or not. Defaults to "yes".

deploy

This script deploys a stack. The stack is created if it does not exist, otherwise it is updated. You must pass the stack name and the path to the docker-compose file as arguments:

./deploy mystack docker-compose.yml

undeploy

This script removes a stack. You must pass the stack name as argument:

./undeploy mystack

License

Source code contained by this project is licensed under the GNU General Public License version 3. See LICENSE file for reference.