zoukankan      html  css  js  c++  java
  • jenkins的pipeline的使用

    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/'
        }
    }
  • 相关阅读:
    linux下安装配置DHCP服务器
    CentOS7安装配置Apache HTTP Server
    CentOS7安装配置DNS服务器
    CentOS7安装配置SAMBA服务器
    小程序全局监听
    springboot+redis
    java对接微信小程序
    获取上一个页面的data
    定时器
    maven项目打包
  • 原文地址:https://www.cnblogs.com/linyouyi/p/10375860.html
Copyright © 2011-2022 走看看