Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

插件的使用效果模糊 #15

Closed
goodboy23 opened this issue Nov 11, 2019 · 11 comments
Closed

插件的使用效果模糊 #15

goodboy23 opened this issue Nov 11, 2019 · 11 comments

Comments

@goodboy23
Copy link

pipline内容

node () {
def workspace = pwd()
def branch = 'prod'

 stage 'checkout'

    dir('parent'){
        git branch: branch, credentialsId: 'jenkins', url: 'http://1.1.1.1/test.git'        
    }

    step([$class: 'MavenSnapshotCheck', check: 'true'])

stage 'Build'
    sh"""
        cd $workspace/test
       /usr/local/maven/bin/mvn clean install -Pprod
    """
}

从日志看是没问题的都正常,但结束后状态显示错误

@goodboy23
Copy link
Author

是在jenkins自带的插件库里,安装的插件,jenkins版本2.190.1 插件版本1.4

@donhui
Copy link
Member

donhui commented Nov 11, 2019

日志和截图提供下吧?
从 pipeline 看不出来问题

@goodboy23
Copy link
Author

Started by user admin
[Pipeline] node
Running on master in /root/.jenkins/workspace/business_indicators-api.jar
[Pipeline] {
[Pipeline] pwd
[Pipeline] stage (checkout)
Using the ‘stage’ step without a block argument is deprecated
Entering stage checkout
Proceeding
[Pipeline] dir
Running in /root/.jenkins/workspace/business_indicators-api.jar/parent
[Pipeline] {
[Pipeline] git
using credential jenkins

/usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
/usr/bin/git config remote.origin.url http://47.94.250.239/cgd-base_dev/parent.git # timeout=10
Fetching upstream changes from http://47.94.250.239/cgd-base_dev/parent.git
/usr/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials
/usr/bin/git fetch --tags --progress http://47.94.250.239/cgd-base_dev/parent.git +refs/heads/:refs/remotes/origin/
/usr/bin/git rev-parse refs/remotes/origin/mvn_refactor^{commit} # timeout=10
/usr/bin/git rev-parse refs/remotes/origin/origin/mvn_refactor^{commit} # timeout=10
Checking out Revision 85df86d121781471033bab0fe3fdaee5cb21b5e4 (refs/remotes/origin/mvn_refactor)
/usr/bin/git config core.sparsecheckout # timeout=10
/usr/bin/git checkout -f 85df86d121781471033bab0fe3fdaee5cb21b5e4
/usr/bin/git branch -a -v --no-abbrev # timeout=10
/usr/bin/git branch -D mvn_refactor # timeout=10
/usr/bin/git checkout -b mvn_refactor 85df86d121781471033bab0fe3fdaee5cb21b5e4
Commit message: "支付结算工程改造,通过从私服取对应版本号的JAR包进行依赖"
/usr/bin/git rev-list --no-walk 85df86d121781471033bab0fe3fdaee5cb21b5e4 # timeout=10
[Pipeline] }
[Pipeline] // dir
[Pipeline] dir
Running in /root/.jenkins/workspace/business_indicators-api.jar/business_indicators
[Pipeline] {
[Pipeline] git
using credential jenkins
/usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
/usr/bin/git config remote.origin.url http://47.94.250.239/cgd-eCommerce_dev/business_indicators.git # timeout=10
Fetching upstream changes from http://47.94.250.239/cgd-eCommerce_dev/business_indicators.git
/usr/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials
/usr/bin/git fetch --tags --progress http://47.94.250.239/cgd-eCommerce_dev/business_indicators.git +refs/heads/:refs/remotes/origin/
/usr/bin/git rev-parse refs/remotes/origin/mvn_refactor^{commit} # timeout=10
/usr/bin/git rev-parse refs/remotes/origin/origin/mvn_refactor^{commit} # timeout=10
Checking out Revision 1cf1c90bd1e75749be7ceace606ddfb243305212 (refs/remotes/origin/mvn_refactor)
/usr/bin/git config core.sparsecheckout # timeout=10
/usr/bin/git checkout -f 1cf1c90bd1e75749be7ceace606ddfb243305212
/usr/bin/git branch -a -v --no-abbrev # timeout=10
/usr/bin/git branch -D mvn_refactor # timeout=10
/usr/bin/git checkout -b mvn_refactor 1cf1c90bd1e75749be7ceace606ddfb243305212
Commit message: "可通过命令(-pl business_indicators-api -am)不打包center工程"
/usr/bin/git rev-list --no-walk 1cf1c90bd1e75749be7ceace606ddfb243305212 # timeout=10
[Pipeline] }
[Pipeline] // dir
[Pipeline] mavenSnapshotCheck
[Maven SNAPSHOT Check]
/root/.jenkins/workspace/business_indicators-api.jar/business_indicators/business_indicators-api/pom.xml:
1.1-SNAPSHOT
/root/.jenkins/workspace/business_indicators-api.jar/business_indicators/business_indicators-center/pom.xml:
1.1-SNAPSHOT
1.1.1-SNAPSHOT
1.1-SNAPSHOT
/root/.jenkins/workspace/business_indicators-api.jar/business_indicators/pom.xml:
1.0.0-SNAPSHOT
1.1-SNAPSHOT
/root/.jenkins/workspace/business_indicators-api.jar/parent/pom.xml:
1.0.0-SNAPSHOT
<elastic-job-lite.version>2.0.6-SNAPSHOT</elastic-job-lite.version>
[Pipeline] stage (Build)
Using the ‘stage’ step without a block argument is deprecated
Entering stage Build
Proceeding
[Pipeline] sh
[business_indicators-api.jar] Running shell script

  • cd /root/.jenkins/workspace/business_indicators-api.jar/parent
  • /usr/local/maven/bin/mvn clean install -Pprod
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ---------------------------< com.cgd:parent >---------------------------
    [INFO] Building parent 1.0.0-SNAPSHOT
    [INFO] --------------------------------[ pom ]---------------------------------
    [INFO]
    [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ parent ---
    [INFO]
    [INFO] --- maven-install-plugin:2.4:install (default-install) @ parent ---
    [INFO] Installing /root/.jenkins/workspace/business_indicators-api.jar/parent/pom.xml to /usr/local/maven/repository/com/cgd/parent/1.0.0-SNAPSHOT/parent-1.0.0-SNAPSHOT.pom
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 0.319 s
    [INFO] Finished at: 2019-11-11T15:49:23+08:00
    [INFO] ------------------------------------------------------------------------
    [Pipeline] }
    [Pipeline] // node
    [Pipeline] End of Pipeline
    Finished: FAILURE

@goodboy23
Copy link
Author

好像插件是生效了,日志也没问题,就最后变成FAILURE了

@donhui
Copy link
Member

donhui commented Nov 11, 2019

/root/.jenkins/workspace/business_indicators-api.jar/business_indicators/business_indicators-api/pom.xml:
1.1-SNAPSHOT
/root/.jenkins/workspace/business_indicators-api.jar/business_indicators/business_indicators-center/pom.xml:
1.1-SNAPSHOT
1.1.1-SNAPSHOT
1.1-SNAPSHOT
/root/.jenkins/workspace/business_indicators-api.jar/business_indicators/pom.xml:
1.0.0-SNAPSHOT
1.1-SNAPSHOT
/root/.jenkins/workspace/business_indicators-api.jar/parent/pom.xml:
1.0.0-SNAPSHOT
<elastic-job-lite.version>2.0.6-SNAPSHOT</elastic-job-lite.version>

从这里看 SNNAPSHOT 校验失败了
按理来说,失败了就应该终止了,你这个还会往下跑

@goodboy23
Copy link
Author

对,pipline就会继续往下跑,使用自有构建的项目,就会直接终止

@donhui
Copy link
Member

donhui commented Nov 11, 2019

谢谢反馈,我看下代码

@donhui
Copy link
Member

donhui commented Nov 11, 2019

在 Jenkins ver. 2.107.3 环境下直接就终止了
应该和 Jenkins 版本有关系,有的版本不兼容~

@goodboy23
Copy link
Author

好的

@donhui
Copy link
Member

donhui commented Nov 12, 2019

@goodboy23
Copy link
Author

好的,感谢 我试试

@donhui donhui closed this as completed Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants