我正在创建下面给出的属性块或地图,我想将其写入文件。我找不到从管道代码将属性写入文件的方法。需要帮助来弄清楚如何去做。
def props = [APPNAME = 'testaoo',
DEPLOY_ENV = stream,
DEPLOY_STREAM = stream_num,
DEPLOY_ENV_TYPE = deploy_env_type,
BUILD_JOB_ID = env.BUILD_JOB_ID,
WAS_NDM_AgentURL= getAgentURL(stream),
WAS_CLUSTER = getClusterName(stream),
DeployPublishNeeded = 'Yes'
]
Run Code Online (Sandbox Code Playgroud)
def props = [
APPNAME : 'testaoo',
DeployPublishNeeded : 'Yes'
]
def content = props.collect{entry->entry.key+"="+entry.value}.join('\n')
writeFile file: 'a.properties', text: content
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4444 次 |
| 最近记录: |