jenkins script 수정
This commit is contained in:
parent
e2ae05904e
commit
102ee4f238
1 changed files with 21 additions and 5 deletions
|
|
@ -46,11 +46,27 @@ class DataComposerJenkins extends DataComposer {
|
|||
Application.log('Start build...');
|
||||
String jsonStr = '';
|
||||
if (Platform.isMacOS || Platform.isLinux) {
|
||||
var shellExe = Platform.isMacOS ? 'zsh' : 'bash';
|
||||
await Process.run(shellExe, [
|
||||
'${Directory.current.path}/assets/script/shell/jenkins_env_params.sh'
|
||||
]).then((ProcessResult result) => jsonStr = result.stdout);
|
||||
jenkinsMap = getMapFromJson(jsonStr)!;
|
||||
var script = '''
|
||||
# shellcheck disable=SC2016
|
||||
echo -e '
|
||||
{
|
||||
"workspace":"'\${WORKSPACE}'",
|
||||
"jenkinsHome":"'\${JENKINS_HOME}'",
|
||||
"jenkinsUrl":"'\${JENKINS_URL}'",
|
||||
"buildUrl":"'\${BUILD_URL}'",
|
||||
"jobUrl":"'\${JOB_URL}'",
|
||||
"jobName":"'\${JOB_NAME}'",
|
||||
"gitCommit":"'\${GIT_COMMIT}'",
|
||||
"buildNumber":'\${BUILD_NUMBER}',
|
||||
"buildID":'\${BUILD_ID}',
|
||||
"buildDisplayName":"'\${BUILD_DISPLAY_NAME}'",
|
||||
"gitBranch":"'\${GIT_BRANCH}'",
|
||||
"buildTag":"'\${BUILD_TAG}'"
|
||||
}'
|
||||
''';
|
||||
var result = await ProcessExecutor.run(StringBuffer(script));
|
||||
print('===================>\n${result.stdout}');
|
||||
jenkinsMap = getMapFromJson(result.stdout)!;
|
||||
|
||||
//write build data
|
||||
var shell = StringBuffer('printf "%s\n" "\${BuildData}"');
|
||||
|
|
|
|||
Loading…
Reference in a new issue