{"id":13582872,"url":"https://github.com/flweber/portainer-stack-updater","last_synced_at":"2026-03-20T00:11:24.877Z","repository":{"id":48316353,"uuid":"199012978","full_name":"flweber/portainer-stack-updater","owner":"flweber","description":"This tool can be used to update a stack via the portainer project.","archived":true,"fork":false,"pushed_at":"2024-04-16T10:01:26.000Z","size":33,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-17T03:17:26.896Z","etag":null,"topics":["cli","nodejs","portainer","portainer-api","portainer-update","stack","update"],"latest_commit_sha":null,"homepage":"https://portainer-update.js.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flweber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-07-26T12:30:04.000Z","updated_at":"2024-04-16T10:03:08.000Z","dependencies_parsed_at":"2024-04-16T11:24:39.123Z","dependency_job_id":"ebb4a764-f082-4a12-9b7f-c43c5f6adf1e","html_url":"https://github.com/flweber/portainer-stack-updater","commit_stats":{"total_commits":30,"total_committers":4,"mean_commits":7.5,"dds":0.5666666666666667,"last_synced_commit":"e83d7ccc2639221066e6630a2c5acae5c025609b"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flweber%2Fportainer-stack-updater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flweber%2Fportainer-stack-updater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flweber%2Fportainer-stack-updater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flweber%2Fportainer-stack-updater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flweber","download_url":"https://codeload.github.com/flweber/portainer-stack-updater/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246811235,"owners_count":20837745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","nodejs","portainer","portainer-api","portainer-update","stack","update"],"created_at":"2024-08-01T15:03:05.463Z","updated_at":"2026-03-20T00:11:24.823Z","avatar_url":"https://github.com/flweber.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"[![Build Status](https://ci.p.webish.one/buildStatus/icon?style=flat-square\u0026job=portainer-stack-updater)](https://ci.p.webish.one/job/portainer-stack-updater/job/master/) ![npm (tag)](https://img.shields.io/npm/v/portainer-update/latest?style=flat-square) ![npm](https://img.shields.io/npm/v/portainer-update?style=flat-square) [![GitHub issues](https://img.shields.io/github/issues/flweber/portainer-stack-updater?style=flat-square)](https://github.com/flweber/portainer-stack-updater/issues) ![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/flweber/portainer-stack-updater?style=flat-square) ![npm](https://img.shields.io/npm/dt/portainer-update?style=flat-square) [![GitHub license](https://img.shields.io/github/license/flweber/portainer-stack-updater?style=flat-square)](https://github.com/flweber/portainer-stack-updater/blob/master/LICENSE) \n# Portainer Update\nThis tool can be used to update a stack via the [portainer project](https://www.portainer.io/).\n## Feature list\n\n - [X] Update existing stacks\n - [X] Read a docker-compose file from file system\n - [X] Make tool available through npx\n - [X] Deploy new stacks\n - [X] Command line tool\n \n ## Usage\n \n==Attention: Portainer only supports compose file version 2 at the moment==\n\n### Example Usage\n## As package\n```javascript\nconst { Auth, Deploy, Update, GetStackByName } = require('portainer-update');\nconst url = \"http://localhost:9000/api\";\n\nAuth(\"username\", \"password\", url)\n\t.then(async (response) =\u003e {\n\t\tconst stacks = [];\n\t\t\n\t\tconst stackid = await GetStackByName(response.jwt, url, \"stackname\");\n\t\t\n\t\t// JsonWebToken, Portainer api url, id of stack which should be updated, \n\t\t// endpoint id, docker compose as string\n\t\tstacks.push(await Update(response.jwt, url, stackid, 1, \"compose string\"));\n\n\t\t// JsonWebToken, Portainer api url, name of the new stack which will be deployed, \n\t\t// endpoint id, docker compose as string\n\t\tstacks.push(await Deploy(response.jwt, url, \"stackname\", 1, \"compose string\"));\n\t\tconsole.info(JSON.stringify(stacks));\n\t});\n\n\n```\n## In Terminal\n ```bash\nnpx portainer-update -p \u003cStackname\u003e -u \u003cPortainer Username\u003e --password \u003cPortainer Password\u003e -f \u003cPath to docker compose\u003e -s \u003cPortainer URL\u003e\n```\n\n### Parameters\n\n|Parameter|Name|Description|Required|\n|:--:|--|:--|:--:|\n|-h \\| --help|Help|Show this parameter table||\n|-e \\| --env|Envrionment|At the moment this parameter has no effect||\n|-p \\| --project|Stackname|The name of the stack you want to update|**X**|\n|-u \\| --user|Portainer Username|The username of the user which will update the stack ==The user need the permission to edit the stack==|**X**|\n|--password|Portainer Password|This tool is for use in CiCD pipelines so please provide the password as a secret variable|**X**|\n|-f \\| --compose|Path to compose|Fill in the path to the compose file, which you want to deploy|**X**|\n|-s \\| --portainersystem|Portainer API URL|The address where to find portainer API (The url you are browsing to in your browser)|Default value: `http://localhost:9000`|\n|--endpoint|Endpoint ID|The id of the endpoint where the stack should be deployed|Default value: `1`|","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflweber%2Fportainer-stack-updater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflweber%2Fportainer-stack-updater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflweber%2Fportainer-stack-updater/lists"}