portainer-redeploy
v1.0.8
Published
A TypeScript client for redeploy a stack in Portainer
Readme
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
- Clone the repository
- Install dependencies:
npm install🔧 Configuration
The client supports configuration through command-line arguments:
| Argument | Description | Default | Required |
| ---------------------- | ------------------------------------------ | -------------- | -------- |
| -b, --base_domain | Portainer base domain | - | No |
| -a, --api_key | Portainer API key | - | Yes |
| -s, --stack_id | Stack ID to interact with | - | Yes |
| -d, --docker_id | Docker image ID for redeployment | - | No |
| -n, --docker_id_name | Environment variable name for Docker image | DOCKER_IMAGE | No |
📖 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 buildRun
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
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- 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-redeployUsage
portainer-redeploy [options]Options
--help: Show help information--version: Show package version
Development
Prerequisites
- Node.js 16.0.0 or higher
- npm
Local Setup
Clone the repository
Install dependencies:
npm installBuild the project:
npm run buildRun in development mode:
npm run dev
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License
