我在做一个新的管道詹金斯为我docker化Vue应用程序。
这是我的 jenkinsfile
的内容
#!groovy
pipeline {
agent any
stages {
stage('Checkout') {
steps {
echo 'Checking out the PR'
checkout scm
}
}
stage('Build') {
steps {
echo 'Destroy Old Build'
sh 'make destroy'
echo 'Building'
sh 'make exec'
sh 'npm run build'
}
}
stage('Test') {
steps {
echo 'Running Tests'
sh 'make exec'
sh 'unset DISPLAY'
sh 'npm run test:e2e'
}
}
stage('Destroy') {
steps {
echo 'Destroy Build'
sh 'make destroy'
}
}
}
}
这是我的 Makefile
up:
docker-compose -f docker-compose.local.yml up
build:
docker-compose -f docker-compose.local.yml build
upbuild_d:
docker-compose -f docker-compose.local.yml up -d --build
exec:
docker-compose -f docker-compose.local.yml up -d --build && docker exec -t merchant-dashboard bash
test-e2e:
docker-compose -f docker-compose.local.yml run frontend npm run test:e2e
destroy:
docker-compose -f docker-compose.local.yml down -v
同时执行 make exec
在 Build
一阶段,它需要很长时间没有完成本阶段对詹金斯直到我失去希望,并中止运行。
任何知道为什么这个问题发生的一切工作的现在我的地方机。