Skip to content

Commit 36ffbc2

Browse files
committed
Merge branch 'dev'
2 parents 0410c48 + 4caa75f commit 36ffbc2

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 0.0.5
2+
3+
## 接口修改
4+
5+
+ 子命令`createorupdatestack`新增参数`deploy_next_wait`用于每次部署时保持一个间隔
6+
17
# 0.0.4
28

39
## bug修复

portainer_deploy_tool/create_or_update_stack.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import time
12
from pathlib import Path
23
from dataclasses import dataclass
34
from copy import deepcopy
@@ -75,6 +76,10 @@
7576
"type": "string",
7677
"description": "执行位置",
7778
"default": "."
79+
},
80+
"deploy_next_wait": {
81+
"type": "number",
82+
"description": "每次部署间隔的时长"
7883
}
7984
}
8085

@@ -289,6 +294,7 @@ def do_main(self) -> None:
289294
repository_username = self.config.get("repository_username")
290295
repository_password = self.config.get("repository_password")
291296
retry_max_times = self.config.get("retry_max_times")
297+
deploy_next_wait = self.config.get("deploy_next_wait")
292298
retry_interval_backoff_factor = self.config.get("retry_interval_backoff_factor")
293299
rq = requests.Session()
294300
if retry_max_times and int(retry_max_times) > 0:
@@ -337,6 +343,8 @@ def do_main(self) -> None:
337343
repositoryURL=repository_url, env=[])
338344
stack.update_or_create(rq, base_url=base_url, jwt=jwt, prune=prune,
339345
repositoryUsername=repository_username, repositoryPassword=repository_password)
346+
if deploy_next_wait:
347+
time.sleep(deploy_next_wait)
340348

341349

342350
def get_swarm_id(rq: requests.Session, base_url: str, jwt: str, endpoint: int) -> str:

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = portainer_deploy_tool
3-
version = 0.0.4
3+
version = 0.0.5
44
author = hsz
55
author_email = hsz1273327@gmail.com
66
description = portainer deploy tool for swarm

0 commit comments

Comments
 (0)