A poor man's kubectl for docker swarm
Project description
Portainer controller
Install
This project is published to PyPi and you can install it using pip:
pip install portainer-ctl
You can also use the published container images:
docker pull hnaderi/pctl
# or
docker pull ghcr.io/hnaderi/pctl
Features
- Fully automated deployment
- Support for multiple config and secret
- Support for .env files and multiple variables
- Support for api tokens introduced in portainer 2.11.0
Usage
usage: pctl [-h] [-T API_TOKEN] [-H HOST] [-U USERNAME] [-P PASSWORD] {deploy,destroy} ...
Portainer deployment client
optional arguments:
-h, --help show this help message and exit
-T API_TOKEN, --api-token API_TOKEN
api token for user, overrides PORTAINER_TOKEN variable
-H HOST, --host HOST portainer host, overrides PORTAINER_HOST variable; defaults to `http://localhost`
-U USERNAME, --username USERNAME
username to login, overrides PORTAINER_USERNAME variable; defaults to `admin`
-P PASSWORD, --password PASSWORD
password for user, overrides PORTAINER_PASSWORD variable; defaults to admin
subcommands:
valid subcommands
{deploy,destroy} additional help
Use it to automate workflows for less mouse clicks!
You can provide host, username and password in environment:
- PORTAINER_HOST
- PORTAINER_USERNAME
- PORTAINER_PASSWORD
- PORTAINER_TOKEN
deploy command
usage: pctl deploy [-h] -f COMPOSE_FILE -n NAME -E {staging,production}
[-S STACK_NAME] [--env-file ENV_FILE] [-e VARIABLE]
[-c CONFIG] [-s SECRET]
options:
-h, --help show this help message and exit
-f COMPOSE_FILE, --compose-file COMPOSE_FILE
compose manifest file
-n NAME, --name NAME deployment name
-E {staging,production}, --environment {staging,production}
environment to deploy on
-S STACK_NAME, --stack-name STACK_NAME
use this to override stack name
--env-file ENV_FILE dot env file used for deployment, it will be used as
stack environment in portainer
-e VARIABLE, --variable VARIABLE
environment variable `SOME_ENV=some-value`
-c CONFIG, --config CONFIG
create config; args must be like `local-path-to-
file:conf-name`; NOTE that as configs are immutable
and might be already in use, your config name must not
exist! use versioning or date in names to always get a
new name
-s SECRET, --secret SECRET
create a new secret; see --config.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file portainer_ctl-0.2.0.tar.gz
.
File metadata
- Download URL: portainer_ctl-0.2.0.tar.gz
- Upload date:
- Size: 29.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8185f0d450ea342a0b48125d3b3b37f93ee6d348e2748982bdb2da57603ea9ec
|
|
MD5 |
623b32a09dac6e0ae44e33e6b50d8ea9
|
|
BLAKE2b-256 |
829f913579b008fdb6a11affe090c6a513d0478953e67f62d1630d72d31ab7f6
|
Provenance
The following attestation bundles were made for portainer_ctl-0.2.0.tar.gz
:
Publisher:
ci.yml
on hnaderi/portainer-ctl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
portainer_ctl-0.2.0.tar.gz
-
Subject digest:
8185f0d450ea342a0b48125d3b3b37f93ee6d348e2748982bdb2da57603ea9ec
- Sigstore transparency entry: 220000397
- Sigstore integration time:
-
Permalink:
hnaderi/portainer-ctl@7de0d892de97c8f1c494bb33ed09d758980a10c5
-
Branch / Tag:
refs/tags/v0.2.0
- Owner: https://github.com/hnaderi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
ci.yml@7de0d892de97c8f1c494bb33ed09d758980a10c5
-
Trigger Event:
push
-
Statement type:
File details
Details for the file portainer_ctl-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: portainer_ctl-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
cb73bbc74be8c8fe4c8491bd3fc4b9f3843def97cb92577bf7af868bf474d1a5
|
|
MD5 |
1f1d32dcc7e2ff5b1a1da699f8e7aca4
|
|
BLAKE2b-256 |
dcb6e37ef8c45cd700a0e6116ef5b6fe552f5d2b0a7ee83b16dd758912768b7c
|
Provenance
The following attestation bundles were made for portainer_ctl-0.2.0-py3-none-any.whl
:
Publisher:
ci.yml
on hnaderi/portainer-ctl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
portainer_ctl-0.2.0-py3-none-any.whl
-
Subject digest:
cb73bbc74be8c8fe4c8491bd3fc4b9f3843def97cb92577bf7af868bf474d1a5
- Sigstore transparency entry: 220000399
- Sigstore integration time:
-
Permalink:
hnaderi/portainer-ctl@7de0d892de97c8f1c494bb33ed09d758980a10c5
-
Branch / Tag:
refs/tags/v0.2.0
- Owner: https://github.com/hnaderi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
ci.yml@7de0d892de97c8f1c494bb33ed09d758980a10c5
-
Trigger Event:
push
-
Statement type: