Jenkins 流水线pineline相关问题

  • jenkins入门学习参考:

    https://blog.csdn.net/u011541946/article/category/7175041

    https://blog.csdn.net/u011541946/article/category/8223796

 

 

  • 问题1:jenkins的job执行后,未archive相关文档。

    需要归档的文档需放在当前job的workplace下,且路径是相对路径。(归档绝对路径的日志失败问题暂未找到解决办法)

      1 - 创建一个目录   # 在pine中创建的目录,默认的当前路径是 jenkins/workplace/your_job_name

      2 - 将需要的日志文档等copy到该目录下

      3 - 对该目录进行归档  # 归档后的文件路径在 jenkins/jobs/your_job_name/builds/job_id/archive

post { 
        failure { 
                sh '''
                    sudo mkdir log
                    sudo scp /xx/xx.log log/ || true
                    sudo scp /xx/xx/xxx.log log/ || true
                '''
                archiveArtifacts log/*
        }   
    }

    参考资料:

https://stackoverflow.com/questions/17392588/no-artifacts-found-that-match-the-file-pattern-what-file-were-it-looking-for#

https://stackoverflow.com/questions/23938310/no-artifacts-found-that-match-the-file-pattern-target-apk#

https://blog.csdn.net/LIQIANGEASTSUN/article/details/79062806

https://www.cnblogs.com/heiyexiaoguai/p/6280311.html

 

 

  • 问题2:pipeline,执行某行shell命令失败后,无法继续执行其他命令

    1 - 某行命令执行失败后不再继续:command || exit 0

    2 - 某行命令执行失败后继续执行:command || true

    参考资料:https://blog.csdn.net/qq_32706349/article/details/87926715

转载于:https://www.cnblogs.com/SodaAir/p/10825445.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值