From 413465ee005d6ad02aef23c6d05d7fadb1bab353 Mon Sep 17 00:00:00 2001
From: wangzilun <964606955@qq.com>
Date: Tue, 08 Mar 2022 16:52:29 +0800
Subject: [PATCH] test234q432
---
Jenkinsfile | 47 +++++++++++++++++++++++++----------------------
1 files changed, 25 insertions(+), 22 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index b269c18..aae900a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -20,27 +20,35 @@
stages {
stage('source') {
steps {
- checkout([$class: 'GitSCM'
- , branches: [[name: "${GIT_BRANCH}"]]
- , doGenerateSubmoduleConfigurations: false
- , extensions: []
- , submoduleCfg: []
- , userRemoteConfigs: [[credentialsId: "${GIT_CREDENTIALS_ID}", url: "${url}"]]
- ])
-
+ script{
+ def changeLogSets = checkout([$class: 'GitSCM'
+ , branches: [[name: "${GIT_BRANCH}"]]
+ , doGenerateSubmoduleConfigurations: false
+ , extensions: []
+ , submoduleCfg: []
+ , userRemoteConfigs: [[credentialsId: "${GIT_CREDENTIALS_ID}", url: "${url}"]]
+ ])
+ println "changeLogSets ${changeLogSets}"
+ }
}
}
- stage('testMaven') {
- steps {
+ //stage('testMaven') {
+ //steps {
//sh 'mvn clean test -U'
- junit allowEmptyResults: true, keepLongStdio: true, skipPublishingChecks: true, testResults: 'target/surefire-reports/*.xml'
+ //junit allowEmptyResults: true, keepLongStdio: true, skipPublishingChecks: true, testResults: 'target/surefire-reports/*.xml'
- }
- }
+ //}
+ //}
stage('testFunction') {
steps {
- sh 'echo test'
+ sh '''
+ commit_name="\$(git show -s --pretty=%an)"
+ commit_message="\$(git show -s --pretty=%s)"
+ echo "\$commit_name"
+ echo "\$commit_message"
+ printenv
+ '''
}
}
@@ -56,11 +64,6 @@
old_version_all=\$(cat \$versionFile | sed -nr \'s/^[^0-9]*"([^"]+)".*;/\\1/p\')
echo "old_version_all \$old_version_all"
echo "project_name \$project_name"
- if [["\${old_version_all}" =~ "\$str"]];then
- echo "包含"
- else
- echo "不包含"
- fi
dir_name=\${project_name}"-"\$old_version_all
echo "dir_name \$dir_name"
##cd target
@@ -83,11 +86,11 @@
steps {
//http(s)的git链接使用帐号密码,ssh使用 keyFileVariable: 'SSH_KEY'
echo "todo version add"
- //versionAddDevelop("${project_name}","${GIT_CREDENTIALS_ID}","${url}","${GIT_BRANCH}")
+ versionAddCom("${project_name}","${GIT_CREDENTIALS_ID}","${url}","${GIT_BRANCH}")
}
}
- stage('version add master') {
+ stage('version add develop') {
when {
//版本号自动添加逻辑需同时符合下列触发条件:
//1. 不能在master分支触发
@@ -109,7 +112,7 @@
}
}
steps {
- versionAddDevelop("${project_name}","${GIT_CREDENTIALS_ID}","${url}","${GIT_BRANCH}")
+ versionAddCom("${project_name}","${GIT_CREDENTIALS_ID}","${url}","${GIT_BRANCH}")
}
}
--
Gitblit v1.9.1