Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
op-web-service
Commits
a2f4f106
Commit
a2f4f106
authored
May 28, 2021
by
lvweichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: deploy ci
parent
1f52d687
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
108 additions
and
0 deletions
+108
-0
update_base_image.sh
bin/update_base_image.sh
+14
-0
deploy-prod-config.sh
deploy_ci/deploy_configs/deploy-prod-config.sh
+32
-0
assemble-yidian-config.sh
deploy_ci/dockerfile/assemble-yidian-config.sh
+23
-0
.exist
deploy_ci/start_env/opservice.yidianzixun.com/htdocs/.exist
+0
-0
.exist
deploy_ci/start_env/opservice.yidianzixun.com/logs/.exist
+0
-0
start.sh
deploy_ci/start_env/opservice.yidianzixun.com/start.sh
+39
-0
No files found.
bin/update_base_image.sh
0 → 100644
View file @
a2f4f106
#!/bin/bash
# 更新项目的基础镜像,当依赖发生更改时,
# 需要将更改后的 package.json 合并到 master 之后执行此脚本
# 执行脚本前置条件:
# 1. 有 swan 权限
# 2. 有测试机 10.103.17.21 的登录权限
name
=
$1
build_machine
=
"10.103.17.21"
echo
"Login in swan to access the build machine. User:
$name
"
ssh
-tt
$name
@swan
"ssh -tt worker@
$build_machine
\"
sh /home/worker/zhangxiaozheng/build_base_images/ui/build_ui_base_image.sh conf/op-web-service.conf init
\"
"
deploy_ci/deploy_configs/deploy-prod-config.sh
0 → 100644
View file @
a2f4f106
#!/usr/bin/env bash
# Start commands for each container, one cmd a line
START_CMDS
=
"tar zxf webui_opwebservice_package.tar.gz -C opservice.yidianzixun.com/htdocs && cd opservice.yidianzixun.com &&
${
start_cmd
}
"
# Container names for each container, one name a line, same order with $start_cmds
CONTAINER_NAMES
=
"webui-opwebservice-
${
env
}
"
# Port maps for each container, one map a line, same order with $start_cmds
DOCKER_PORT_MAPS
=
"9008:8055"
# This is for changing container name, remove old containers when deploy new one
OLD_CONTAINER_NAMES
=
"
webui-opwebservice-
${
env
}
webui-opwebservice
"
# Volumn maps for each container, one map a line, same order with $start_cmds
DOCKER_VOLUMN_MAPS
=
"
~/_logs/webui-opwebservice-
${
env
}
:/home/worker/opservice.yidianzixun.com/logs
"
# Other docker run options
DOCKER_RUN_OPTIONS
=
""
# Image name
IMAGE_NAME
=
"docker2.yidian.com:5000/publish/webui-opwebservice-master-
${
COMMIT_NUMBER
}
-image"
# This is for stopping container, kill sepicify process inside the container before 'docker stop' and 'docker rm'
DOCKER_PRESTOP_CMD
=
""
# Service port for apitest
SERVICE_PORT
=
"9008"
# Service port inside container
ORIGIN_SERVICE_PORT
=
"8055"
deploy_ci/dockerfile/assemble-yidian-config.sh
0 → 100644
View file @
a2f4f106
#!/usr/bin/env bash
DIST_FILE_NAME
=
"webui_opwebservice_package.tar.gz"
PROJECT_DIR
=
"metro.yidianzixun.com"
START_SCRIPT
=
"./start_env/
${
PROJECT_DIR
}
/start.sh"
SYNC_DATA_OPERATIONS
=
""
DEST_FILE_NAME
=
"webui_metro_package.tar.gz"
DEST_FILE_PATH
=
"start_env"
BASE_IMAGE
=
"docker2.yidian.com:5000/webui/metro:20200310"
MAINTAINER
=
""
HOME_DIR
=
"/home/worker"
LOG_DIRS
=
"
${
HOME_DIR
}
/
${
PROJECT_DIR
}
/logs"
DATA_DIRS
=
""
deploy_ci/start_env/opservice.yidianzixun.com/htdocs/.exist
0 → 100644
View file @
a2f4f106
deploy_ci/start_env/opservice.yidianzixun.com/logs/.exist
0 → 100644
View file @
a2f4f106
deploy_ci/start_env/opservice.yidianzixun.com/start.sh
0 → 100644
View file @
a2f4f106
rm
/home/worker/metro.yidianzixun.com/logs/start_script.done
cd
/home/worker/metro.yidianzixun.com/htdocs/
mv
/opt/project_lib/node_modules /home/worker/metro.yidianzixun.com/htdocs/
env
=
$1
port
=
$2
if
[
$env
!=
""
]
;
then
cd
/home/worker/recipe/
$env
sh ./
*
.rule
cd
-
fi
if
[
X
"
$port
"
=
X]
;
then
$port
=
8066
fi
cd
/home/worker/metro.yidianzixun.com/htdocs/
if
[
X
"
$env
"
=
X
"prod"
]
;
then
echo
"{
\"
pm2-logrotate
\"
:{
\"
max_size
\"
:
\"
524288000
\"
,
\"
interval
\"
:
\"
7
\"
,
\"
retain
\"
:
\"
10
\"
},
\"
module-db
\"
:{
\"
pm2-logrotate
\"
:true}}"
>
/root/.pm2/module_conf.json
port
=
8066
pm2 start pm2.json
else
PORT
=
$port
NODE_ENV
=
$env
pm2 start index.js
--name
'metro'
--watch
fi
while
true
;
do
s
=
`
netstat
-ntl
|
grep
":
${
port
}
"
-c
`
if
[
"X
$s
"
!=
"X"
]
&&
[
"
$s
"
!=
"0"
]
;
then
break
fi
pm2 restart all
;
sleep
10
;
done
touch
/home/worker/metro.yidianzixun.com/logs/start_script.done
while
true
;
do
sleep
30
;
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment