Jenkins集成Gitlab流水线

参考这篇文章就够了

https://www.zxblinux.com/archives/665

另外,备注下流水线的配置:

pipeline {

    agent any

    stages {

        stage('Git Pull') {

            steps {

                echo 'Update source from gitlab...'

                checkout([$class: 'GitSCM', branches: [[name: '*/develop']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: '/usr/local/src/***/***']], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '********', url: 'http://git.*****.com/****/***.git']]])

            }

        }

        stage('Maven Build: umf') {

            steps {

                echo 'Build and deploy...'

                sh '/usr/local/apache-maven-3.5.4/bin/mvn -f /usr/local/src/***/***/src/***/pom.xml clean package install deploy -U -Dmaven.test.skip=true'

            }

        }

    }

}

你可能感兴趣的:(Jenkins集成Gitlab流水线)