This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from io import StringIO | |
def env_substitute(_str, **context): | |
buffer = StringIO() | |
var_scope = None | |
for id_char, char in enumerate(_str): | |
if char == '$' and _str[id_char + 1] == '{': | |
continue | |
if char == '{' and _str[id_char - 1] == '$': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import os | |
import xlrd | |
import re | |
# 获取指定路径文件的MD5的全大写 | |
def get_md5(file_path): | |
if not os.path.isfile(file_path): | |
return None | |
with open(file_path,'rb') as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
def deployOptions = 'no\nyes' | |
def userInput = input( | |
id: 'userInput', message: 'Are you prepared to deploy?', parameters: [ | |
[$class: 'ChoiceParameterDefinition', choices: deployOptions, description: 'Approve/Disallow deployment', name: 'deploy-check'] | |
] | |
) | |
echo "you selected: ${userInput}" | |
} |