diff --git a/Jenkinsfile b/Jenkinsfile index 3482e08..71debcf 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -92,38 +92,9 @@ pipeline { def imageTag = "${BUILD_NUMBER}-${env.GIT_COMMIT.take(7)}" env.IMAGE_TAG = imageTag - // 创建一个简单的 nginx 配置(可选) - sh ''' - cat > nginx.conf << 'EOF' - events { - worker_connections 1024; - } - - http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - - server { - listen 80; - server_name localhost; - - location / { - root /usr/share/nginx/html; - index index.html index.htm; - try_files $uri $uri/ /index.html; - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } - } - } - EOF - ''' - sh """ - docker build -t ${DOCKER_IMAGE}:latest . + docker build -t ${DOCKER_IMAGE}:${imageTag} . + docker tag ${DOCKER_IMAGE}:${imageTag} ${DOCKER_IMAGE}:latest """ } }