Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
test-cicd
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
胡凯旋
test-cicd
Commits
318b42df
Commit
318b42df
authored
Jan 15, 2019
by
胡凯旋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add .gitlab-ci.yml
parent
e26717a1
Pipeline
#1
failed
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
0 deletions
+75
-0
.gitlab-ci.yml
.gitlab-ci.yml
+75
-0
No files found.
.gitlab-ci.yml
0 → 100644
View file @
318b42df
stages
:
-
test
-
build
-
deploy_integration
-
deploy_staging
-
deploy_production
variables
:
MYSQL_DATABASE
:
test
MYSQL_ALLOW_EMPTY_PASSWORD
:
yes
SEA_ENV
:
testing
DOCKER_HOST
:
tcp://dockerd:2375
IMAGE
:
registry.mydocker.com/devops/${CI_PROJECT_NAMESPACE}-${CI_PROJECT_NAME}
before_script
:
-
IMAGE_TAG=${IMAGE}:${CI_COMMIT_SHA:0:8}
#========================================= Unit Testing ================================================
test_all
:
image
:
python:3.7
stage
:
test
services
:
-
name
:
mysql:5.6
alias
:
mysql
-
name
:
redis:4
alias
:
redis
before_script
:
-
pip install -U -r requirements.txt
script
:
-
flake8 app jobs
-
sea test
#========================================== Build Image =================================================
build_image
:
stage
:
build
only
:
-
master
tags
:
-
build
script
:
-
docker build -t ${IMAGE_TAG} -f Dockerfile .
-
docker push ${IMAGE_TAG}
deploy_rpc_integration
:
stage
:
deploy_integration
only
:
-
master
tags
:
-
deploy-integration
script
:
-
kubectl -n xyz set image deploy/examples-rpc "app=${IMAGE_TAG}" --record
deploy_staging
:
stage
:
deploy_staging
only
:
-
master
tags
:
-
deploy-production
when
:
manual
script
:
-
kubectl -n xyz-staging set image deploy/examples-celery "app=${IMAGE_TAG}" --record
-
kubectl -n xyz-staging set image deploy/examples-rpc "app=${IMAGE_TAG}" --record
deploy_production
:
stage
:
deploy_production
only
:
-
master
tags
:
-
deploy-production
when
:
manual
script
:
-
kubectl -n xyz set image deploy/examples-celery "app=${IMAGE_TAG}" --record
-
kubectl -n xyz set image deploy/examples-rpc "app=${IMAGE_TAG}" --record
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