pipeline {
agent any
parameters {
gitParameter(
branchFilter: 'origin/(.*)', //高階中設定為這個
defaultValue: 'master',
name: 'BRANCH',
type: 'PT_BRANCH',
useRepository: 'https://gitlab.lingtingshidai.com/lt/java/lt-comment-service.git'
)
}
stages {
stage('Checkout') {
steps {
git branch: "${params.BRANCH}", credentialsId: '0f085850-1868-454d-8520-f59542af257f', url: 'https://gitlab.lingtingshidai.com/lt/java/lt-comment-service.git'
}
}
stage('Build') {
steps {
script {
sh 'source /etc/profile && /usr/local/jenkins/apache-maven-3.6.3/bin/mvn clean package -U -Dmaven.test.skip=true -B'
}
}
}
}
}