mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
2.1 KiB
2.1 KiB
Portainer Stack Utils
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.
Requirements
How to use
Two scripts are included: deploy.sh
and undeploy.sh
. Both scripts use the following environment variables to connect to the portainer instance:
PORTAINER_USER
(string): UsernamePORTAINER_PASSWORD
(string): PasswordPORTAINER_URL
(string): URL to PortainerPORTAINER_PRUNE
("true" or "false"): Whether to prune unused containers or not. Defaults to"false"
.PORTAINER_ENDPOINT
(int): Which endpoint to use. Defaults to1
.HTTPIE_VERIFY_SSL
("yes" or "no"): Whether to verify SSL certificate or not. Defaults to"yes"
.
deploy.sh
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.sh mystack docker-compose.yml
undeploy.sh
This script removes a stack. You must pass the stack name as argument:
./undeploy.sh mystack
License
Source code contained by this project is licensed under the GNU General Public License version 3. See LICENSE file for reference.