Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
install.web
Project
Project
Details
Activity
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
Script
install.web
Commits
264e730d
Commit
264e730d
authored
Mar 16, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update .gitlab-ci.yml
parent
ad914ec9
Pipeline
#20789
failed
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
22 deletions
+7
-22
.gitlab-ci.yml
.gitlab-ci.yml
+7
-22
No files found.
.gitlab-ci.yml
View file @
264e730d
...
...
@@ -6,7 +6,7 @@ stages:
-
deploy
variables
:
APP_NAME
:
dxserver
_web
APP_NAME
:
install
_web
APP_IMAGE
:
"
${HUANSI_REGISTRY_URL}/huansi/${APP_NAME}"
before_script
:
...
...
@@ -19,6 +19,8 @@ build:
-
dev
script
:
-
docker build -t ${APP_IMAGE}:${CI_COMMIT_REF_NAME} .
except
:
master
push
:
stage
:
push
...
...
@@ -26,25 +28,8 @@ push:
tags
:
-
dev
script
:
-
docker push ${APP_IMAGE}:${CI_COMMIT_REF_NAME}
-
docker build -t ${APP_IMAGE}:${APP_VERSION} .
-
docker push ${APP_IMAGE}:${APP_VERSION}
-
echo "success"
except
:
-
dev
deploy-master
:
stage
:
deploy
retry
:
2
tags
:
-
dev
variables
:
APP_CNAME
:
"
${APP_NAME}-${CI_COMMIT_REF_NAME}"
# 默认不需要操作
APP_PORT
:
8110
# 开放端口号,这个需要申请端口号开放 以下都是环境变量
API
:
"
http://172.17.0.1:8109/"
# 环境变量 API地址
PORT
:
8000
#环境变量 PORT
script
:
-
docker ps -a | grep -i ${APP_CNAME} > /dev/null 2>&1 && docker stop ${APP_CNAME} && docker rm ${APP_CNAME}
-
docker images|grep none|grep ${APP_IMAGE} > /dev/null 2>&1 && docker images|grep none|grep ${APP_IMAGE}|awk '{print $3}'|xargs docker rmi
# 参考环境变量的传递,-e "API1=${API2}",将API2变量传给至程序的API1接收
-
docker run --name ${APP_CNAME} -d -p ${APP_PORT}:8000 -e "API=${API}" -e "PORT=${PORT}" $APP_IMAGE:${CI_COMMIT_REF_NAME}
only
:
-
master
\ No newline at end of file
-
web
\ No newline at end of file
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