A very small utility for triggering the Git re-deploy for stacks in Portainer via CLI. It was meant to be used in CD pipelines.
A container image is available on Docker Hub: docker.io/enrico204/portainer-git-redeploy
Example with environment variables:
$ export PORTAINER_STACK_ID=1
$ export PORTAINER_URL=https://portainer:9443
$ export PORTAINER_ACCESS_TOKEN=abcdef
$ portainer-git-redeploy
Example using CLI options (note that writing your access token to the CLI is a BAD IDEA):
$ portainer-git-redeploy -url https://portainer:9443 -stack-id 1 -access-token abcdef
To use a custom certificate file, use PORTAINER_SSL_CERT_FILE
to appending a
certificate to the system CA store, or SSL_CERT_FILE
for replacing the whole
CA store:
$ export PORTAINER_SSL_CERT_FILE=~/certificate.pem
$ portainer-git-redeploy -url https://portainer:9443 -stack-id 1 -access-token abcdef
See LICENSE.