代码拉取完成,页面将自动刷新
同步操作将从 OpenATC/OpenATC-Admin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
pipeline {
agent { label 'buildx' }
stages {
stage('submodule pull') {
steps {
dir("${env.WORKSPACE}") {
sh 'pwd'
sh 'git submodule update --init --recursive'
}
}
}
stage('Build Docs') {
agent {
docker {
image 'openatc/mkdocs-tools:1.4.2'
reuseNode true
}
}
steps {
dir("${env.WORKSPACE}/openatc-doc/OpenATCAdminManual_cn") {
sh 'mkdocs build --no-directory-urls'
}
dir("${env.WORKSPACE}/openatc-doc/OpenATCAdminManual_eng") {
sh 'mkdocs build --no-directory-urls'
}
dir("${env.WORKSPACE}/openatc-doc/OpenATCconfigerManual_cn") {
sh 'mkdocs build --no-directory-urls'
}
dir("${env.WORKSPACE}/openatc-doc/OpenATCconfigerManual_eng") {
sh 'mkdocs build --no-directory-urls'
}
dir("${env.WORKSPACE}/openatc-doc") {
sh 'rm UserManual -rf'
sh 'rm configserver -rf'
sh 'mkdir -p UserManual/openatcAdmin'
sh 'mkdir -p configserver/UserManual/openatcConfig'
sh 'cp -r OpenATCAdminManual_cn/site/ UserManual/openatcAdmin/zh/'
sh 'cp -r OpenATCAdminManual_eng/site/ UserManual/openatcAdmin/en/'
sh 'cp -r OpenATCconfigerManual_cn/site/ configserver/UserManual/openatcConfig/zh/'
sh 'cp -r OpenATCconfigerManual_eng/site/ configserver/UserManual/openatcConfig/en/'
}
}
}
stage('Build Configure') {
agent {
docker {
image 'openatc/pnpm:6-node14'
args '-v /data/.pnpm-store:/root/.local/share/pnpm/store -u 0:0 --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'
sh 'cp -r ../../openatc-doc/configserver/UserManual dist'
sh 'tar -zcvf ConfigWithUserManual.tar.gz dist'
}
}
}
stage('Build Web') {
agent {
docker {
image 'openatc/pnpm:6-node14'
args '-v /data/.pnpm-store:/root/.local/share/pnpm/store -u 0:0 --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 ../../openatc-doc/UserManual dist'
sh 'cp -r ../../openatc-doc/configserver/UserManual dist'
sh 'cp -r dist ../../OpenATC-Admin-server/agent/src/main/resources/static'
// sh 'cp -r ../../openatc-doc/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 -u 0:0 --entrypoint=\'\''
reuseNode true
}
}
steps {
dir("${env.WORKSPACE}/OpenATC-Admin-server") {
sh 'mvn clean install'
}
}
}
stage('Publish') {
steps {
archiveArtifacts artifacts: 'OpenATC-Admin-server/target/agent.jar, OpenATC-Admin-ui/OpenATC-Configer-web/Configdist.tar.gz,OpenATC-Admin-ui/OpenATC-Configer-web/ConfigWithUserManual.tar.gz, OpenATC-Admin-ui/OpenATC-Admin-web/admindist.tar.gz', followSymlinks: false, onlyIfSuccessful: true
}
}
stage('Building image & push') {
steps {
dir("${env.WORKSPACE}/OpenATC-Admin-server/agent") {
script {
echo "building img for branch: ${env.BRANCH_NAME} and tag: ${env.TAG_NAME}"
if ( env.TAG_NAME != null ){
sh "docker buildx build --platform linux/amd64,linux/arm64/v8 -t openatc/openatc-admin:${env.TAG_NAME} --push ."
} else if (env.BRANCH_NAME == 'master') {
sh "docker buildx build --platform linux/amd64,linux/arm64/v8 -t openatc/openatc-admin:latest --push ."
} else {
sh "docker buildx build --platform linux/amd64,linux/arm64/v8 -t openatc/openatc-admin-${env.BRANCH_NAME}:latest --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}"
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。