You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
853 B
30 lines
853 B
pipeline {
|
|
agent any
|
|
environment {
|
|
GIT_URL = 'http://git.gkcorp.com.vn:16000/sundayenglish/test-project.git'
|
|
BRANCH = 'master'
|
|
DEST_DIR = '/projects/test-project'
|
|
}
|
|
stages {
|
|
stage('Checkout Code') {
|
|
steps {
|
|
// Jenkins Git plugin will handle the clone and checkout automatically
|
|
checkout([
|
|
$class: 'GitSCM',
|
|
branches: [[name: "*/${BRANCH}"]],
|
|
userRemoteConfigs: [[url: GIT_URL]]
|
|
])
|
|
|
|
sh "touch demo.php"
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
success {
|
|
echo "Code has been successfully pulled and copied to ${DEST_DIR}"
|
|
}
|
|
failure {
|
|
echo "Failed to pull code from the repository."
|
|
}
|
|
}
|
|
}
|
|
|