From 44fa52cd8bdf8dd1cb7f2cfb59472d6a24ca513e Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Fri, 26 Jun 2026 13:57:26 -0400 Subject: [PATCH 1/3] change Jenkinsfile --- Jenkinsfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5e10f1c..3659391 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -71,10 +71,14 @@ pipeline { steps { script { def branchArg = env.CHANGE_ID - ? "--branch=pr-${env.CHANGE_ID}" - : "--branch=${env.BRANCH_NAME}" + ? "pr-${env.CHANGE_ID}" + : "${env.BRANCH_NAME}" - sh "pnpm wrangler pages deploy ./.vitepress/dist --project-name=${PRJ_NAME} ${branchArg}" + if (env.BRANCH_NAME == 'main') { + sh 'npx wrangler deploy' + } else { + sh "npx wrangler versions upload --preview-alias ${branchArg}" + } } } } -- 2.43.0 From 7c96f56867d3b1c6b14bea6f3e09d63f6aad38d5 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Fri, 26 Jun 2026 14:13:12 -0400 Subject: [PATCH 2/3] .replaceAll('/', '-') --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3659391..6fe0563 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,7 +72,7 @@ pipeline { script { def branchArg = env.CHANGE_ID ? "pr-${env.CHANGE_ID}" - : "${env.BRANCH_NAME}" + : ${env.BRANCH_NAME}.replaceAll('/', '-') if (env.BRANCH_NAME == 'main') { sh 'npx wrangler deploy' -- 2.43.0 From 9db247edafe9a3aab7a7e6b9d70576fa48573160 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Fri, 26 Jun 2026 14:30:31 -0400 Subject: [PATCH 3/3] change the way to call --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6fe0563..4763306 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,7 +72,7 @@ pipeline { script { def branchArg = env.CHANGE_ID ? "pr-${env.CHANGE_ID}" - : ${env.BRANCH_NAME}.replaceAll('/', '-') + : env.BRANCH_NAME.replaceAll('/', '-') if (env.BRANCH_NAME == 'main') { sh 'npx wrangler deploy' -- 2.43.0