Skip to content

Commit

Permalink
www
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzhaomax committed Apr 23, 2024
1 parent 9c8eb1a commit 5c39f78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pipeline {
Host_port = "9600" // 启用随机端口,会被赋值
JobName = "go-maxms-react/main"
DeploymentServerIP = "172.16.96.98"
StaticFolderName = "maxblog"
}
// 流水线阶段
stages {
Expand Down Expand Up @@ -202,7 +203,7 @@ pipeline {
echo "Port: ${Host_port}"
sh """
chmod +x ./server/deploy.sh
./server/deploy.sh $harborAddress $harborRepo $ProjectKey $TAG $Container_port $Host_port $ENV $DeploymentServerIP
./server/deploy.sh $harborAddress $harborRepo $ProjectKey $TAG $Container_port $Host_port $ENV $DeploymentServerIP $StaticFolderName
"""
}
echo "--------------------- Deploy End ---------------------"
Expand Down
3 changes: 2 additions & 1 deletion server/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ container_port=$5
host_port=$6
environment=$7
deployment_server_ip=$8
static_folder_name=$9

# 确保没有container在运行
containerID=$(docker -H tcp://$deployment_server_ip:2375 ps -a | grep "${project}" | awk '{print $1}')
Expand Down Expand Up @@ -45,7 +46,7 @@ docker -H tcp://$deployment_server_ip:2375 run \
--privileged=true \
-p "${host_port}:${container_port}" \
-e ENV="${environment}" \
-v /root/www/"${project}":/usr/src/app/www \
-v /root/static/"${static_folder_name}"/www:/usr/src/app/www \
-v /root/logs/"${project}":/usr/src/app/log \
"$imageName"

Expand Down

0 comments on commit 5c39f78

Please sign in to comment.