image.png
image.png
image.png
image.png
替换成下方配置
pipeline {
agent any
stages {
stage('检出') {
steps {
checkout([
$class: 'GitSCM',
branches: [[name: env.GIT_BUILD_REF]],
userRemoteConfigs: [[url: env.GIT_REPO_URL, credentialsId: env.CREDENTIALS_ID]]
])
}
}
stage('推送部署') {
steps {
echo '正在推送文件...'
sh 'git fetch https://用户名:申请的token@gitee.com/用户名/仓库名.git'
sh 'git push -f https://用户名:申请的token@gitee.com/用户名/仓库名.git HEAD:master'
echo '已完成文件推送.'
}
}
}
}
@后面就是你要推送到的仓库地址带有.git