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
3a07a752
Commit
3a07a752
authored
Jun 09, 2021
by
luchaowu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ci
parent
da2d20c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
.gitlab-ci.yml
.gitlab-ci.yml
+71
-0
No files found.
.gitlab-ci.yml
0 → 100644
View file @
3a07a752
variables
:
# 构建后的镜像名
DEPLOY_DOCKER_NAME
:
harbor.int.yidian-inc.com/open-tech/open-$CI_PROJECT_NAME-pipeline-$CI_PIPELINE_ID-image
PORT
:
"
8055"
# 定义 stages
stages
:
#- install_deps
#- build
-
assemble
-
deploy
-
over
build_docker
:
stage
:
assemble
before_script
:
-
docker login -u harbor_ops -p pssreO3P2S1., harbor.int.yidian-inc.com
script
:
-
ls -la
-
pwd
-
npm run web-build
-
docker ps
-
docker build -t $DEPLOY_DOCKER_NAME .
-
docker push $DEPLOY_DOCKER_NAME
tags
:
-
superfe_docker
when
:
manual
#services:
# - docker:dind
only
:
-
web
deploy_test
:
stage
:
deploy
dependencies
:
-
build_docker
script
:
-
export CONTAINER_NAME_PREFIX="open-$CI_PROJECT_NAME-test-$PORT"
# 移除旧版本container
-
bash deploy/remove_old_docker.sh $CONTAINER_NAME_PREFIX
-
docker pull $DEPLOY_DOCKER_NAME
-
docker run -d -t -i -e TZ=Asia/Shanghai --name $CONTAINER_NAME_PREFIX-$CI_JOB_ID-image --net=host -p $PORT:$PORT $DEPLOY_DOCKER_NAME /bin/sh -c "cd /home/worker/opservice.yidian-inc.com/htdocs && pm2 start pm2-test.json"
#- bash deploy/check_port.sh $PORT
tags
:
-
11_shell
environment
:
name
:
test
url
:
http://venus.int.yidian-inc.com:$PORT
when
:
manual
only
:
-
web
report_success
:
stage
:
over
dependencies
:
-
deploy_test
script
:
-
sh deploy/dingdingrobot.sh "gitlab-ci pipeline【成功】" "#### 【$GITLAB_USER_NAME】 triggered pipeline [$CI_PROJECT_NAME - $CI_PIPELINE_ID]($CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID) on branch [$CI_COMMIT_REF_NAME], Deployed to [http://venus.int.yidian-inc.com:$PORT](http://venus.int.yidian-inc.com:$PORT)"
tags
:
-
superfe_shell
when
:
manual
only
:
-
web
# report_error:
# stage: over
# script:
# - sh deploy/dingdingrobot.sh "gitlab-ci pipeline【失败】" "pipeline run failed:[$CI_PROJECT_NAME - $CI_PIPELINE_ID]($CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID) "
# tags:
# - 10_103_35_79_shell
# when: on_failure
\ 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