栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

jenkins从gitlab克隆代码简单案例

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

jenkins从gitlab克隆代码简单案例

一、添加凭据
系统管理—>>manage credential—>>系统—>>添加凭据,如下:


二、创建gitlab项目

root@Think-pad:~/pipeline-helloworld-scm# vim Jenkinsfile
pipeline {
    agent any
    stages {
        stage('hello') {
            steps {
                echo "hello world"
            }
        }
    }
}

root@Think-pad:~/pipeline-helloworld-scm# git add .
root@Think-pad:~/pipeline-helloworld-scm# git commit -m "update the Jenkinsfile to pipeline format"
[master 7d4b04e] update the Jenkinsfile to pipeline format
 1 file changed, 10 insertions(+), 1 deletion(-)
root@Think-pad:~/pipeline-helloworld-scm# git push -u origin
Username for 'http://192.168.1.12': root
Password for 'http://root@192.168.1.12': 
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 343 bytes | 343.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To http://192.168.1.12/root/pipeline-helloworld-scm.git
   a16bbed..7d4b04e  master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.


三、创建pipeline流水线

配置流水线,选择"scm",如下:


脚本路径默认为Jenkins

四、开始构建



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/334048.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号