diff --git a/lastcommit.txt b/lastcommit.txt index 35ea3c3..5266f88 100644 --- a/lastcommit.txt +++ b/lastcommit.txt @@ -1 +1 @@ -83607de4be0a6c7a8911c51bd4878e2190dd90d9 \ No newline at end of file +52981e4a0e78be01e1306419c16693b82816518f \ No newline at end of file diff --git a/main.py b/main.py index 0077e78..59ed7cc 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,5 @@ # This is a sample Python script. - +import json # Press to execute it or replace it with your code. # Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings. @@ -148,21 +148,24 @@ def do(): write_last_commit_ver(last_commits[0]) # 执行jenkins远程部署 - logger.log("本次要发布的服务:", svc_set) - deploy_svcs(svc_set) + if svc_set: + logger.info("本次要发布的服务:" + str(svc_set)) + else: + logger.info('本次没有服务可以发布') + # deploy_svcs(svc_set) finally: stream.close() -# if __name__ == '__main__': -# do() - -@app.route(rule='/on-dev-push', methods=['GET']) -def on_dev_push(): +if __name__ == '__main__': do() - return "success" - -app.run(host="0.0.0.0", port=7998, debug=False) # 多线程模式 +# @app.route(rule='/on-dev-push', methods=['GET']) +# def on_dev_push(): +# do() +# return "success" +# +# +# app.run(host="0.0.0.0", port=7998, debug=False) # 多线程模式 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..023ec63 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +requests +flask \ No newline at end of file diff --git a/test.py b/test.py index df6e609..ba516dd 100644 --- a/test.py +++ b/test.py @@ -1,13 +1,11 @@ import re, os from log_conf import logger -# 项目绝对路径 -git_project_env = os.environ.get('JWHT_GIT_PROJECT_DIR') -git_project_dir = git_project_env if git_project_env else "epmet-saas" +users = set() +# users.add('x') -# 上一次提交记录文件 -last_deploy_commit_record = os.environ.get('JWHT_LAST_DEPLOY_COMMIT_RECORD') -commit_record_file_path = last_deploy_commit_record if last_deploy_commit_record else "./lastcommit.txt" - -logger.error(git_project_dir) -logger.info(commit_record_file_path) +if users: + print('1') +else: + print('0') + 本次没有服务可以发布 \ No newline at end of file