首页 > 其他 > 详细

34,k8s jenkins 之微服务自动化部署 之jenkins pipeline测试

时间:2020-08-15 13:38:45      阅读:114      评论:0      收藏:0      [点我收藏+]
1,由于默认插件源在国外服务器,大多数网络无法顺利下载,需修改国内插件源地址:
cd jenkins_home/updates
sed -i ‘s/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g‘ default.json && sed -i ‘s/http:\/\/www.google.com/https:\/\/www.baidu.com/g‘ default.json
然后重启Jenkins:http://192.168.0.14:30006/restart

2,先安装pipeline插件。
pipeline {
   agent any

   stages {
      stage(‘1,拉取代码‘) {
		steps {
            echo "1"
        }
      }
	  stage(‘1,代码编译‘) {
		steps {
            echo "2"
        }
      }
	  stage(‘1,单元测试‘) {
		steps {
            echo "3"
        }
      }
   }
}

 

拉取代码:

技术分享图片

 

 技术分享图片

 

 技术分享图片

 

 

pipeline {
   agent any
   parameters {
		choice choices: [‘192.168.0.11:/root/a.git‘, ‘192.168.0.11:/root/b.git‘, ‘192.168.0.11:/root/c.git‘], description: ‘请选择要发布项目的git地址‘, name: ‘git‘
   
        choice choices: [‘192.168.0.10‘, ‘192.168.0.11‘, ‘192.168.0.12‘], description: ‘请选择要发布项目的服务器‘, name: ‘host‘
   }

   stages {
      stage(‘1,拉取代码‘) {
		steps {
            echo "1"
        }
      }
	  stage(‘1,代码编译‘) {
		steps {
            echo "2"
        }
      }
	  stage(‘1,单元测试‘) {
		steps {
            echo "3"
        }
      }
   }
}

 

34,k8s jenkins 之微服务自动化部署 之jenkins pipeline测试

原文:https://www.cnblogs.com/k8s-pod/p/13508391.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!