Skip to content

Commit 7b2ca00

Browse files
committed
Merge branch 'dev'
2 parents 994d276 + c5ef11b commit 7b2ca00

File tree

7 files changed

+31
-6
lines changed

7 files changed

+31
-6
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,4 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130-
131130
.devcontainer

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# 0.0.3
2+
3+
## 接口修改
4+
5+
+ 子命令`updateservicebywebhook``tokens`参数现在是位置参数
6+
+ 子命令`updateservicebywebhook`现在可以用执行目录下的`update_service_by_webhooks_config.json`文件作为配置
7+
+ 子命令`createorupdatestack``endpoints`参数现在是位置参数
8+
+ 子命令`createorupdatestack`现在可以用执行目录下的`create_or_update_stack_config.json`文件作为配置
9+
+ 子命令`updateserviceinstack``deploy_path`参数参数现在是位置参数
10+
+ 子命令`updateserviceinstack`现在可以用执行目录下的`update_service_in_stack_config.json`文件作为配置
11+
12+
## bug修复
13+
14+
+ 修复`updateservicebywebhook`的调用url错误
15+
116
# 0.0.2
217

318
## 接口修改

dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ ADD README.md /code/README.md
99
ADD setup.cfg /code/setup.cfg
1010
ADD setup.py /code/setup.py
1111
RUN python setup.py install
12+
WORKDIR /
13+
RUN rm -rf /code
1214
ENTRYPOINT [ "python","-m", "portainer_deploy_tool"]

portainer_deploy_tool/create_or_update_stack.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ class CreateOrUpdateStack(EntryPoint):
233233
default_config_file_paths = [
234234
"./create_or_update_stack_config.json"
235235
]
236+
argparse_noflag = "endpoints"
236237
schema = {
237238
"$schema": "http://json-schema.org/draft-07/schema#",
238239
"type": "object",

portainer_deploy_tool/update_service_by_webhook.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323

2424
class UpdateServiceByWebhooks(EntryPoint):
2525
"""利用webhook更新已经存在的service."""
26+
default_config_file_paths = [
27+
"./update_service_by_webhooks_config.json"
28+
]
29+
argparse_noflag = "tokens"
2630
schema = {
2731
"$schema": "http://json-schema.org/draft-07/schema#",
2832
"type": "object",
@@ -42,7 +46,7 @@ def do_main(self) -> None:
4246
rq.mount('https://', HTTPAdapter(max_retries=Retry(total=int(retry_max_times), backoff_factor=retry_interval_backoff_factor, method_whitelist=frozenset(['GET', 'POST', 'PUT']))))
4347
log.initialize_for_app(app_name="UpdateStack", log_level=log_level)
4448
for token in tokens:
45-
res = rq.post(f"{base_url}/webhooks/{token}")
49+
res = rq.post(f"{base_url}/api/webhooks/{token}")
4650
if res.status_code >= 300 or res.status_code <= 199:
4751
log.error("update service query get error", status_code=res.status_code)
4852
else:

portainer_deploy_tool/update_service_in_stack.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555

5656
class UpdateServiceInStack(EntryPoint):
5757
"""更新已经存在的stack."""
58+
default_config_file_paths = [
59+
"./update_service_in_stack_config.json"
60+
]
61+
argparse_noflag = "deploy_path"
5862
schema = {
5963
"$schema": "http://json-schema.org/draft-07/schema#",
6064
"type": "object",

setup.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[metadata]
22
name = portainer_deploy_tool
3-
version = 0.0.2
4-
author = hsz12
5-
author_email =
6-
description =
3+
version = 0.0.3
4+
author = hsz
5+
author_email = hsz1273327@gmail.com
6+
description = portainer deploy tool for swarm
77
long_description = file: README.md, CHANGELOG.md, LICENSE
88
long_description_content_type = text/markdown
99
keywords = portainer, docker-compose, git

0 commit comments

Comments
 (0)