1、安装Pipeline Maven Integration

2、新建任务

3、编写pipeline代码

node {

   stage('get clone') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '66fea565-4c7b-43b6-ae50-26afcf11a9c7', url: 'http://git.xxxxxx.com/java/GG.git']]])
//checkout([$class: 'GitSCM', branches: [[name: '*/dev']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '66fea565-4c7b-43b6-ae50-26afcf11a9c7', url: 'http://git.xxxxxx.com/java/GG.git']]])
}
stage('mvn test') {
withMaven(Maven: 'maven3.5.4') {
sh "mvn test"
}
} stage('mvn install') {
withMaven(Maven: 'maven3.5.4') {
sh "mvn install"
}
} }
node {
stage('depoly') {
//ssh -t -t 是给予伪终端,后面的命令不需要用分号分开
sh 'ssh -t -t root@172.17.10.34 cp /jenkins/workspace/yyy/target/xxxx-*.jar /dir1/yyy/'
}
}

jenkins的pipeline的使用的更多相关文章

  1. [转]利用Jenkins的Pipeline实现集群自动化部署SpringBoot项目

    环境准备 Git: 安装部署使用略. Jenkins: 2.46.2版本安装部署略(修改jenkins执行用户为root,省得配置权限) JDK: 安装部署略. Maven: 安装部署略. 服务器免密 ...

  2. Jenkins流水线(pipeline)实战之:从部署到体验

    关于Jenkins流水线(pipeline) Jenkins 流水线 (pipeline) 是一套插件,让Jenkins可以实现持续交付管道的落地和实施. 关于blueocean Blue Ocean ...

  3. 远程触发Jenkins的Pipeline任务

    场景 虽然能配置提交代码时触发Jenkins任务,但有时并不需要每次提交代码都触发,而是仅在有需要时才执行. 除了在Jenkins页面上手动执行任务,还可以向Jenkins网站发起HTTP请求,触发指 ...

  4. 远程触发Jenkins的Pipeline任务的并发问题处理

    前文概述 本文是<远程触发Jenkins的pipeline任务>的续篇,上一篇文章实战了如何通过Http请求远程触发指定的Jenkins任务,并且将参数传递给Jenkins任务去使用,文末 ...

  5. jenkins~管道Pipeline的使用,再见jenkinsUI

    Pipeline在Jenkins里的作用 最近一直在使用jenkins进行自动化部署的工作,开始觉得很爽,省去了很多重复的工作,它帮助我自动拉服务器的代码,自动还原包包,自动编译项目,自动发布项目,自 ...

  6. Jenkins和pipeline

    Jenkins https://jenkins.io/index.html The leading open source automation server, Jenkins provides hu ...

  7. jenkins之 pipeline 小尝试

    最近,一个小需求,动态建立slave节点来执行自动化用例,原有jenkins 老方式不满足需求,就用到jenkins2的pipeline来实现,但在实现过程中,2个小坑记录下 1.jenkins不能读 ...

  8. Jenkins的Pipeline脚本在美团餐饮SaaS中的实践

    一.背景 在日常开发中,我们经常会有发布需求,而且还会遇到各种环境,比如:线上环境(Online),模拟环境(Staging),开发环境(Dev)等.最简单的就是手动构建.上传服务器,但这种方式太过于 ...

  9. Jenkins CI Pipeline scripting

    Jenkins pipeline is a suite of Jenkins plugins. Pipelines can be seen as a sequence of stages to per ...

随机推荐

  1. xampp+YII搭建网站

    一.安装xampp xampp专为php开发设计,需要的apache,mysql,php已经自带了.特别提醒,请下载PHP版本高于5.4支持Yii2.0的xampp 二.配置环境变量 在系统的环境变量 ...

  2. [Bayes] openBUGS: this is not the annoying bugs in programming

    Bayesian inference Using Gibbs Sampling 允许用户指定复杂的多层模型,并可使用MCMC算法来估计模型中的未知参数. We use DAGs to specify ...

  3. vue图片放大镜效果

    原作者地址:https://github.com/lemontree2000/vue-magnify 经测试,原插件在使用时有bug,即在预览时进行鼠标滚动,导致遮罩层计算错误.我已修复该bug,特分 ...

  4. 使用log4cplus时遇到的链接错误:无法解析的外部符号 "public: static class log4cplus::Logger __cdecl log4cplus::Logger::getInstance(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,

    #include "stdafx.h" #include <log4cplus/logger.h> #include <log4cplus/loggingmacr ...

  5. scala 模式匹配详解 1

    什么是模式? 一些刚从java转到scala的同学在开发的过程中犹如深陷沼泽,因为很多的概念或风格不确定,scala里有很多的坑,模式匹配也算一个.我整理了一下自己所理解的概念,以及一些例子.这个系列 ...

  6. 倍福TwinCAT3上位机与PLC通信测试(ADS通信) 包含C#和C++代码

    倍福TwinCAT3上位机与PLC通信测试(ADS通信) 包含C#和C++代码 本次测试需要环境: VS2013,TwinCAT3(本人版本TC31-Full-Setup.3.1.4018.16) 代 ...

  7. [原]openstack-kilo--issue(十)ERROR: openstack Unable to establish connection to http://controller:35357/v3/auth/tokens

    ====环境== openstack :kilo CentOS : 7 ====问题=== 在没有关vm的情况下,重启了controller. 问题一: 在使用nova service-list 或者 ...

  8. logback logback.xml常用配置详解(一)<configuration> and <logger>

    logback logback.xml常用配置详解(一)<configuration> and <logger> 博客分类: Log java loglogback  原创文章 ...

  9. python字符串魔法

    test = 'alEx' print(test.capitalize()) # 首字母大写 其他都变小写 print(test.casefold()) # 变小写 更牛逼 print(test.lo ...

  10. [No0000156]天干地支-狗年我懂,戊戌二字怎么来的?

    话说,这几年的年份,总能让人联想到历史课本.比如,2014年是甲午马年,是中日甲午战争120周年.而2018年是戊戌狗年,嗯,戊戌变法也过去120年了…… 狗年相信大家都了解,小观前面两期关于反犬旁和 ...