1.0.8 • Published 6 months ago

portainer-redeploy v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

Portainer API Client

📝 Overview

A powerful TypeScript-based client for interacting with the Portainer API, designed to manage Docker stacks and endpoints with ease.

✨ Features

  • 🌐 Retrieve Portainer endpoints
  • 📋 List and retrieve stack information
  • 🔄 Redeploy stacks with custom configurations
  • 💻 Command-line interface for seamless interaction

🛠 Prerequisites

  • Node.js: v14 or later
  • npm: v6 or later

🚀 Installation

  1. Clone the repository
  2. Install dependencies:
npm install

🔧 Configuration

The client supports configuration through command-line arguments:

ArgumentDescriptionDefaultRequired
-b, --base_domainPortainer base domain-No
-a, --api_keyPortainer API key-Yes
-s, --stack_idStack ID to interact with-Yes
-d, --docker_idDocker image ID for redeployment-No
-n, --docker_id_nameEnvironment variable name for Docker imageDOCKER_IMAGENo

📖 Usage Examples

Get Stack Information

npm start -- stack -s <STACK_ID> -a <API_KEY>

Redeploy Stack

npm start -- redeploy -s <STACK_ID> -a <API_KEY> -d <NEW_DOCKER_IMAGE>

🛠 Development

Build

npm run build

Run

npm start

⚠️ Error Handling

The client will exit with a non-zero status code if:

  • API request fails
  • Stack redeployment is unsuccessful
  • Invalid arguments are provided

🔒 Security Notes

  • Never commit your API key to version control
  • Use environment variables or secure credential management for API keys

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

📄 License

ISC License

Portainer Redeploy CLI

Description

A command-line tool for redeploying stacks in Portainer quickly and easily.

Installation

You can install this package globally using npm:

npm install -g portainer-redeploy

Usage

portainer-redeploy [options]

Options

  • --help: Show help information
  • --version: Show package version

Development

Prerequisites

  • Node.js 16.0.0 or higher
  • npm

Local Setup

  1. Clone the repository
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build
  4. Run in development mode:

    npm run dev

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago

0.0.1

7 months ago