# portainer-companion

> Tool to assist on Portainer stack updates

Latest version **2.0.0** (published 2019-01-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install portainer-companion
pnpm add portainer-companion
yarn add portainer-companion
bun add portainer-companion
```

Provides the command `portainer`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-01-17 |
| First published | 2019-01-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ~10.15.0 |
| Dependencies | 2 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | d3c0d3dpt |
| Maintainers | d3c0d3dpt |

## Links

- npm: https://www.npmjs.com/package/portainer-companion
- Repository: https://github.com/d3c0d3dpt/portainer-companion
- Homepage: https://github.com/d3c0d3dpt/portainer-companion#readme
- Issues: https://github.com/d3c0d3dpt/portainer-companion/issues
- npm.io page: https://npm.io/package/portainer-companion

## Dependencies (2)

- [commander](https://npm.io/package/commander.md) ^2.19.0
- [portainer-api-client](https://npm.io/package/portainer-api-client.md) 0.0.2

## Recent versions

- 2.0.0 (latest) — 2019-01-17
- 1.3.0 — 2019-01-15
- 1.2.1 — 2019-01-12
- 1.2.0 — 2019-01-11
- 1.1.0 — 2019-01-11
- 1.0.1 — 2019-01-10
- 1.0.0 — 2019-01-10

## README

# Portainer Companion

Command Line utility to update a Docker Stacks on Portainer.

## Configuration

Define the following environment variables to configure Portainer connection:
* `PORTAINER_URL`: Url for Portainer access (ex: http://127.0.0.1:9000/); 
* `PORTAINER_USERNAME`: Username for Portainer login;
* `PORTAINER_PASSWORD`: Password for Portainer login.

Use the following environment variables for behavior configuration
* `FORCE_UPDATE`: Update Portainer stack even if stack definition hasn't changed (defaults to `false`).

## Installation (suggested)

Install the package globally:
* `npm i -g portainer-companion`

## Usage

On the command-line:
* `portainer`, `portainer -h` or `portainer --help` to output usage information.

* `portainer update-stack-definition [options] <stack_name> <stack_file>` to update a stack definition on Portainer:
  * Alias(es): `usd`;
  * `<stack_name>`: name of the Portainer stack to be updated;
  * `<stack_file>`: file that contains the stack definition;
  * Available `options`:
    * `-f`, `--force`: force update (updates even if definition hasn't changed);
    * `-h`, `--help`:  output usage information.
    
* `portainer update-stack-variable <stack_name> <variable_name> [<variable_value>]` to update a stack variable on Portainer:
  * Alias(es): `usv`;
  * `<stack_name>`: name of the Portainer stack where variable will be updated;
  * `<variable_name>`: name of the variable to be updated;
  * `[<variable_value>]`: new value of the variable;
  * Notes:
    * If a variable with that name doesn't exists, it will be created.
    * If no value is given, the variable will be removed

---
_Source: https://npm.io/package/portainer-companion · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
