jenkins support
Some checks failed
test/timeline-frontend/pipeline/head There was a failure building this commit
Some checks failed
test/timeline-frontend/pipeline/head There was a failure building this commit
This commit is contained in:
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
@@ -25,25 +25,25 @@ pipeline {
|
|||||||
stages {
|
stages {
|
||||||
stage('Checkout') {
|
stage('Checkout') {
|
||||||
steps {
|
steps {
|
||||||
|
checkout scm
|
||||||
script {
|
script {
|
||||||
if (params.GIT_COMMIT) {
|
echo "当前分支: ${params.BRANCH_NAME}"
|
||||||
checkout scm
|
|
||||||
sh "git reset --hard ${params.GIT_COMMIT}"
|
|
||||||
} else {
|
|
||||||
checkout scm
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "当前构建的 Git Commit: ${env.GIT_COMMIT}"
|
}
|
||||||
|
stage('Build timeline-frontend dist') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
// 确保先执行前端构建命令
|
||||||
|
sh 'npm install'
|
||||||
|
sh 'npm run build' // 这会生成 dist 目录
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Build Docker Image') {
|
stage('Build Docker Image') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
// 确保先执行前端构建命令
|
|
||||||
sh 'npm install'
|
|
||||||
sh 'npm run build' // 这会生成 dist 目录
|
|
||||||
|
|
||||||
def imageTag = "${BUILD_NUMBER}-${env.GIT_COMMIT.take(7)}"
|
def imageTag = "${BUILD_NUMBER}-${env.GIT_COMMIT.take(7)}"
|
||||||
env.IMAGE_TAG = imageTag
|
env.IMAGE_TAG = imageTag
|
||||||
sh """
|
sh """
|
||||||
|
|||||||
Reference in New Issue
Block a user