Commit 4115da51 authored by alex yao's avatar alex yao

UPDATE JENKINS FILE

parent 49a6d0d2
......@@ -44,6 +44,15 @@ end_time=`date +'%Y-%m-%d,%H:%m:%S'`'''
steps {
sh '''# docker-compose pull env
curl -X PUT http://$dcui_address/api/v1/projects --data \'{"id":"\'$dcui_project_id\'"}\' -H\'Content-type: application/json\''''
sh '''
# 获取正在运行的容器ID
container_id=$(docker ps -aqf "ancestor=$registry_address/$docker_image_group_name/$docker_image_name")
# 如果有正在运行的容器,停止并删除它
if [ ! -z "$container_id" ]; then
docker stop $container_id
docker rm $container_id
fi
'''
sh '''# docker-compose up
curl -X POST http://$dcui_address/api/v1/projects --data \'{"id":"\'$dcui_project_id\'"}\' -H\'Content-type: application/json\''''
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment