代码拉取完成,页面将自动刷新
同步操作将从 OpenATC/OpenATC-Admin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
pipeline {
agent { label 'docker' }
stages {
stage('Build Configure') {
agent {
docker {
image 'openatc/pnpm:6-node14'
args '-v /data/.pnpm-store:/root/.local/share/pnpm/store --entrypoint=\'\''
reuseNode true
}
}
steps {
dir("${env.WORKSPACE}/OpenATC-Admin-ui/OpenATC-Configer-web") {
sh 'pnpm install --no-frozen-lockfile'
sh 'pnpm run package:prod'
sh 'pnpm run build'
sh 'tar -zcvf Configdist.tar.gz dist'
}
}
}
stage('Build Web') {
agent {
docker {
image 'openatc/pnpm:6-node14'
args '-v /data/.pnpm-store:/root/.local/share/pnpm/store --entrypoint=\'\''
reuseNode true
}
}
steps {
dir("${env.WORKSPACE}/OpenATC-Admin-ui/OpenATC-Admin-web") {
sh 'pnpm install --no-frozen-lockfile'
sh 'pnpm run build'
sh 'rm ../../OpenATC-Admin-server/agent/src/main/resources/static -rf'
sh 'cp -r dist ../../OpenATC-Admin-server/agent/src/main/resources/static'
// todo: sh 'cp -r /root/UserManual ../../OpenATC-Admin-server/agent/src/main/resources/static'
sh 'tar -zcvf admindist.tar.gz dist'
}
}
}
stage('Build Server Agent') {
agent {
docker {
image 'maven:amazoncorretto'
args '-v /data/.m2:/root/.m2 --entrypoint=\'\''
reuseNode true
}
}
steps {
dir("${env.WORKSPACE}/OpenATC-Admin-server") {
sh 'mvn clean install'
}
}
}
// stage('Build Configer Server') {
// agent {
// docker {
// image 'maven:amazoncorretto'
// args '-v /data/.m2:/root/.m2 --entrypoint=\'\''
// reuseNode true
// }
// }
// steps {
// dir("${env.WORKSPACE}/OpenATC-Admin-server/configserver") {
// sh 'mvn clean package'
// }
// }
// }
stage('Publish') {
steps {
// archiveArtifacts artifacts: 'OpenATC-Admin-server/target/agent.jar, OpenATC-Admin-server/configserver/target/ConfigServer.jar, OpenATC-Admin-ui/OpenATC-Configer-web/Configdist.tar.gz, OpenATC-Admin-ui/OpenATC-Admin-web/admindist.tar.gz', followSymlinks: false, onlyIfSuccessful: true
archiveArtifacts artifacts: 'OpenATC-Admin-server/target/agent.jar, OpenATC-Admin-ui/OpenATC-Configer-web/Configdist.tar.gz, OpenATC-Admin-ui/OpenATC-Admin-web/admindist.tar.gz', followSymlinks: false, onlyIfSuccessful: true
}
}
stage('Building image & push') {
steps {
script {
def buildImg
echo "building img for branch: ${env.BRANCH_NAME} and tag: ${env.TAG_NAME}"
if (env.BRANCH_NAME == 'master' || (env.TAG_NAME) != null ) {
buildImg=docker.build('openatc/openatc-admin:latest', "${env.WORKSPACE}/OpenATC-Admin-server/agent")
} else {
buildImg=docker.build("openatc/openatc-admin-${env.BRANCH_NAME}:latest", "${env.WORKSPACE}/OpenATC-Admin-server/agent")
}
docker.withRegistry('', 'openatc-docker-hub') {
buildImg.push()
}
}
}
}
stage('Add Docker Version Tag') {
when {
buildingTag()
}
steps {
sh "docker tag openatc/openatc-admin:latest openatc/openatc-admin:${env.TAG_NAME}"
script {
docker.withRegistry('', 'openatc-docker-hub') {
docker.image("openatc/openatc-admin:${env.TAG_NAME}").push()
}
}
}
}
}
post {
failure{
emailext to: "${env.OPENATC_FAILURE_MAIL_RECV}",
subject: "jenkins build:${currentBuild.currentResult}: ${env.JOB_NAME}",
body: "${currentBuild.currentResult}: Job ${env.JOB_NAME}\nMore Info can be found here: ${env.BUILD_URL}"
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。