mirror of
https://github.com/Hopiu/portainer-cli.git
synced 2026-03-16 22:10:34 +00:00
-f --> -sf
This commit is contained in:
parent
6fd3767cc7
commit
b4e6dbccfb
2 changed files with 21 additions and 21 deletions
28
README.md
28
README.md
|
|
@ -52,13 +52,13 @@ portainer-cli login douglas d1234
|
||||||
Create a stack.
|
Create a stack.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
portainer-cli create_stack -n stack_name -e endpoint_id -f stack_file
|
portainer-cli create_stack -n stack_name -e endpoint_id -sf stack_file
|
||||||
```
|
```
|
||||||
|
|
||||||
**E.g:**
|
**E.g:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
portainer-cli create_stack -n stack_name -e 1 stack-test -f docker-compose.yml
|
portainer-cli create_stack -n stack_name -e 1 stack-test -sf docker-compose.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Flags
|
#### Flags
|
||||||
|
|
@ -67,27 +67,27 @@ portainer-cli create_stack -n stack_name -e 1 stack-test -f docker-compose.yml
|
||||||
|--|--|
|
|--|--|
|
||||||
| `-n` or `-stack-name` | Stack name |
|
| `-n` or `-stack-name` | Stack name |
|
||||||
| `-e` or `-endpoint-id` | Endpoint id (required) |
|
| `-e` or `-endpoint-id` | Endpoint id (required) |
|
||||||
| `-f` or `-stack-file` |Stack file |
|
| `-sf` or `-stack-file` |Stack file |
|
||||||
| `-w` or `-env-file` | Pass env file path, usually `.env` |
|
| `-ef` or `-env-file` | Pass env file path, usually `.env` |
|
||||||
|
|
||||||
### update_stack command
|
### update_stack command
|
||||||
|
|
||||||
Update a stack.
|
Update a stack.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
portainer-cli update_stack -s stack_id -e endpoint_id -f stack_file
|
portainer-cli update_stack -s stack_id -e endpoint_id -sf stack_file
|
||||||
```
|
```
|
||||||
|
|
||||||
**E.g:**
|
**E.g:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
portainer-cli update_stack -s 18 -e 1 -f docker-compose.yml
|
portainer-cli update_stack -s 18 -e 1 -sf docker-compose.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Environment variables arguments
|
#### Environment variables arguments
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
portainer-cli update_stack id -s stack_id -e endpoint_id -f stack_file --env.var=value
|
portainer-cli update_stack id -s stack_id -e endpoint_id -sf stack_file --env.var=value
|
||||||
```
|
```
|
||||||
|
|
||||||
Where `var` is the environment variable name and `value` is the environment variable value.
|
Where `var` is the environment variable name and `value` is the environment variable value.
|
||||||
|
|
@ -98,8 +98,8 @@ Where `var` is the environment variable name and `value` is the environment vari
|
||||||
|--|--|
|
|--|--|
|
||||||
| `-s` or `-stack-id` | Stack id |
|
| `-s` or `-stack-id` | Stack id |
|
||||||
| `-e` or `-endpoint-id` | Endpoint id (required) |
|
| `-e` or `-endpoint-id` | Endpoint id (required) |
|
||||||
| `-f` or `-stack-file` |Stack file |
|
| `-sf` or `-stack-file` |Stack file |
|
||||||
| `-w` or `-env-file` | Pass env file path, usually `.env` |
|
| `-ef` or `-env-file` | Pass env file path, usually `.env` |
|
||||||
| `-p` or `--prune` | Prune services |
|
| `-p` or `--prune` | Prune services |
|
||||||
| `-c` or `--clear-env` | Clear all environment variables |
|
| `-c` or `--clear-env` | Clear all environment variables |
|
||||||
|
|
||||||
|
|
@ -108,19 +108,19 @@ Where `var` is the environment variable name and `value` is the environment vari
|
||||||
Create or update a stack based on it's name.
|
Create or update a stack based on it's name.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
portainer-cli create_or_update_stack -n stack_name -e endpoint_id -f stack_file
|
portainer-cli create_or_update_stack -n stack_name -e endpoint_id -sf stack_file
|
||||||
```
|
```
|
||||||
|
|
||||||
**E.g:**
|
**E.g:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
portainer-cli update_stack -s 18 -e 1 -f docker-compose.yml
|
portainer-cli update_stack -s 18 -e 1 -sf docker-compose.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Environment variables arguments
|
#### Environment variables arguments
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
portainer-cli create_or_update_stack -n stack_name -e endpoint_id -f stack_file --env.var=value
|
portainer-cli create_or_update_stack -n stack_name -e endpoint_id -sf stack_file --env.var=value
|
||||||
```
|
```
|
||||||
|
|
||||||
Where `var` is the environment variable name and `value` is the environment variable value.
|
Where `var` is the environment variable name and `value` is the environment variable value.
|
||||||
|
|
@ -131,8 +131,8 @@ Where `var` is the environment variable name and `value` is the environment vari
|
||||||
|--|--|
|
|--|--|
|
||||||
| `-n` or `-stack-name` | Stack name |
|
| `-n` or `-stack-name` | Stack name |
|
||||||
| `-e` or `-endpoint-id` | Endpoint id (required) |
|
| `-e` or `-endpoint-id` | Endpoint id (required) |
|
||||||
| `-f` or `-stack-file` |Stack file |
|
| `-sf` or `-stack-file` |Stack file |
|
||||||
| `-w` or `-env-file` | Pass env file path, usually `.env` |
|
| `-ef` or `-env-file` | Pass env file path, usually `.env` |
|
||||||
| `-p` or `--prune` | Prune services |
|
| `-p` or `--prune` | Prune services |
|
||||||
| `-c` or `--clear-env` | Clear all environment variables |
|
| `-c` or `--clear-env` | Clear all environment variables |
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -273,8 +273,8 @@ class PortainerCLI(object):
|
||||||
@plac.annotations(
|
@plac.annotations(
|
||||||
stack_name=('Stack name', 'option', 'n', str),
|
stack_name=('Stack name', 'option', 'n', str),
|
||||||
endpoint_id=('Endpoint id', 'option', 'e', int),
|
endpoint_id=('Endpoint id', 'option', 'e', int),
|
||||||
stack_file=('Stack file', 'option', 'f'),
|
stack_file=('Stack file', 'option', 'sf'),
|
||||||
env_file=('Environment Variable file', 'option', 'w'),
|
env_file=('Environment Variable file', 'option'),
|
||||||
prune=('Prune services', 'flag', 'p'),
|
prune=('Prune services', 'flag', 'p'),
|
||||||
clear_env=('Clear all env vars', 'flag', 'c'),
|
clear_env=('Clear all env vars', 'flag', 'c'),
|
||||||
)
|
)
|
||||||
|
|
@ -289,10 +289,10 @@ class PortainerCLI(object):
|
||||||
@plac.annotations(
|
@plac.annotations(
|
||||||
stack_name=('Stack name', 'option', 'n'),
|
stack_name=('Stack name', 'option', 'n'),
|
||||||
endpoint_id=('Endpoint id', 'option', 'e', int),
|
endpoint_id=('Endpoint id', 'option', 'e', int),
|
||||||
stack_file=('Environment Variable file', 'option', 'f')
|
stack_file=('Environment Variable file', 'option', 'sf'),
|
||||||
env_file=('Environment Variable file', 'option', 'w')
|
env_file=('Environment Variable file', 'option', 'ef')
|
||||||
)
|
)
|
||||||
def create_stack(self, stack_name, endpoint_id, stack_file, env_file='', *args):
|
def create_stack(self, stack_name, endpoint_id, stack_file='', env_file='', *args):
|
||||||
logger.info('Creating stack name={}'.format(stack_name))
|
logger.info('Creating stack name={}'.format(stack_name))
|
||||||
stack_url = 'stacks?type=1&method=string&endpointId={}'.format(
|
stack_url = 'stacks?type=1&method=string&endpointId={}'.format(
|
||||||
endpoint_id
|
endpoint_id
|
||||||
|
|
@ -392,8 +392,8 @@ class PortainerCLI(object):
|
||||||
@plac.annotations(
|
@plac.annotations(
|
||||||
stack_id=('Stack id', 'option', 's', int),
|
stack_id=('Stack id', 'option', 's', int),
|
||||||
endpoint_id=('Endpoint id', 'option', 'e', int),
|
endpoint_id=('Endpoint id', 'option', 'e', int),
|
||||||
stack_file=('Stack file', 'option', 'f'),
|
stack_file=('Stack file', 'option', 'sf'),
|
||||||
env_file=('Environment Variable file', 'option', 'w'),
|
env_file=('Environment Variable file', 'option', 'ef'),
|
||||||
prune=('Prune services', 'flag', 'p'),
|
prune=('Prune services', 'flag', 'p'),
|
||||||
clear_env=('Clear all env vars', 'flag', 'c'),
|
clear_env=('Clear all env vars', 'flag', 'c'),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue