From f7b529b1bdb9ecc56e35e6fe0861308a6b426580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B9=9B=E5=85=AE?= Date: Fri, 5 Jun 2026 15:08:13 +0800 Subject: [PATCH] chore: move Jenkins pipeline config out of repo --- Jenkinsfile.prod | 102 ----------------------------------------------- 1 file changed, 102 deletions(-) delete mode 100644 Jenkinsfile.prod diff --git a/Jenkinsfile.prod b/Jenkinsfile.prod deleted file mode 100644 index e0267d9..0000000 --- a/Jenkinsfile.prod +++ /dev/null @@ -1,102 +0,0 @@ -pipeline { - agent any - - parameters { - gitParameter( - name: 'RELEASE_TAG', - type: 'PT_TAG', - tagFilter: 'v*', - branchFilter: 'origin/(.*)', - sortMode: 'DESCENDING_SMART', - selectedValue: 'TOP', - useRepository: 'http://127.0.0.1:3001/my-project/my-resume.git', - quickFilterEnabled: false, - listSize: '10', - requiredParameter: true, - description: '请选择要部署到生产环境的 Git Tag。列表自动来自当前项目仓库,生产只能从 Tag 发布。' - ) - } - - environment { - CI = 'true' - } - - options { - timestamps() - disableConcurrentBuilds() - buildDiscarder(logRotator(numToKeepStr: '10')) - } - - stages { - stage('Checkout Tag') { - steps { - checkout([ - $class: 'GitSCM', - branches: [[name: '*/master']], - userRemoteConfigs: [[ - url: 'http://127.0.0.1:3001/my-project/my-resume.git' - ]] - ]) - sh ''' - set -eu - test -n "$RELEASE_TAG" - NORMALIZED_RELEASE_TAG="$(printf '%s' "$RELEASE_TAG" | sed 's/\\^{}$//')" - case "$NORMALIZED_RELEASE_TAG" in - v[0-9A-Za-z._-]*) ;; - *) echo "Invalid release tag: $NORMALIZED_RELEASE_TAG"; exit 2 ;; - esac - if ! git ls-remote --exit-code --tags origin "refs/tags/$NORMALIZED_RELEASE_TAG" >/dev/null; then - echo "Release tag does not exist in repository: $NORMALIZED_RELEASE_TAG" - exit 3 - fi - echo "Deploying production tag: $NORMALIZED_RELEASE_TAG" - git fetch --tags --force - git checkout -f "refs/tags/$NORMALIZED_RELEASE_TAG" - git describe --tags --exact-match HEAD - ''' - } - } - - stage('Env') { - steps { - sh ''' - git --version - node -v - npm -v - ''' - } - } - - stage('Install') { - steps { - sh ''' - npm ci - ''' - } - } - - stage('Check') { - steps { - sh ''' - node -v - npm -v - ''' - } - } - - stage('Build') { - steps { - sh ''' - npm run build:prod - test -f dist/index.html - ''' - } - } - - stage('Deploy Production') { - steps { - sh 'sudo /usr/local/bin/deploy-my-resume-from-jenkins "$WORKSPACE"' - } - } - } -}