mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-01-22 21:08:13 -05:00
Fix CI
This commit is contained in:
parent
2900a0b9e4
commit
b9c940efa8
35
Jenkinsfile
vendored
35
Jenkinsfile
vendored
@ -12,33 +12,17 @@ pipeline {
|
|||||||
stages {
|
stages {
|
||||||
stage('Prepare') {
|
stage('Prepare') {
|
||||||
steps {
|
steps {
|
||||||
sh '''docker pull jc21/nginx-proxy-manager-base
|
sh 'docker pull jc21/nginx-proxy-manager-base'
|
||||||
docker pull ${DOCKER_CI_TOOLS}'''
|
sh 'docker pull $DOCKER_CI_TOOLS'
|
||||||
|
|
||||||
sh '''CWD=`pwd`
|
|
||||||
docker run --rm \\
|
|
||||||
-v $CWD/manager:/srv/manager \\
|
|
||||||
-w /srv/manager \\
|
|
||||||
jc21/nginx-proxy-manager-base \\
|
|
||||||
npm --registry=$NPM_REGISTRY install
|
|
||||||
exit $?'''
|
|
||||||
|
|
||||||
sh '''CWD=`pwd`
|
|
||||||
docker run --rm -v $CWD/manager:/srv/manager -w /srv/manager jc21/nginx-proxy-manager-base gulp build
|
|
||||||
exit $?'''
|
|
||||||
|
|
||||||
sh '''CWD=`pwd`
|
|
||||||
docker run --rm -e NODE_ENV=production -v $CWD/manager:/srv/manager -w /srv/manager jc21/nginx-proxy-manager-base npm prune --production
|
|
||||||
exit $?'''
|
|
||||||
|
|
||||||
sh '''docker run --rm \\
|
|
||||||
-v $(pwd)/manager:/data \\
|
|
||||||
${DOCKER_CI_TOOLS} \\
|
|
||||||
node-prune'''
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
|
sh 'docker run --rm -v $(pwd)/manager:/srv/manager -w /srv/manager jc21/$IMAGE_NAME-base yarn --registry=$NPM_REGISTRY install'
|
||||||
|
sh 'docker run --rm -v $(pwd)/manager:/srv/manager -w /srv/manager jc21/$IMAGE_NAME-base gulp build'
|
||||||
|
sh 'rm -rf node_modules'
|
||||||
|
sh 'docker run --rm -v $(pwd)/manager:/srv/manager -w /srv/manager jc21/$IMAGE_NAME-base yarn --registry=$NPM_REGISTRY install --prod'
|
||||||
|
sh 'docker run --rm -v $(pwd)/manager:/data $DOCKER_CI_TOOLS node-prune'
|
||||||
sh 'docker build -t $TEMP_IMAGE_NAME .'
|
sh 'docker build -t $TEMP_IMAGE_NAME .'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -59,8 +43,6 @@ node-prune'''
|
|||||||
sh 'docker push docker.io/jc21/$IMAGE_NAME:latest'
|
sh 'docker push docker.io/jc21/$IMAGE_NAME:latest'
|
||||||
sh 'docker push docker.io/jc21/$IMAGE_NAME:$TAG_VERSION'
|
sh 'docker push docker.io/jc21/$IMAGE_NAME:$TAG_VERSION'
|
||||||
}
|
}
|
||||||
|
|
||||||
sh 'docker rmi $TEMP_IMAGE_NAME'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -74,6 +56,9 @@ node-prune'''
|
|||||||
failure {
|
failure {
|
||||||
slackSend color: "#d61111", message: "FAILED: <${BUILD_URL}|${JOB_NAME}> build #${BUILD_NUMBER} - Duration: ${currentBuild.durationString}"
|
slackSend color: "#d61111", message: "FAILED: <${BUILD_URL}|${JOB_NAME}> build #${BUILD_NUMBER} - Duration: ${currentBuild.durationString}"
|
||||||
}
|
}
|
||||||
|
always {
|
||||||
|
sh 'docker rmi $TEMP_IMAGE_NAME'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user