Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
tingweiwang
/
ksyun-CICD-test
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d1cad601
authored
May 06, 2020
by
tingweiwang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
1 parent
c4d6578e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
deploy.sh
k8s_yaml/deployment.yaml
k8s_yaml/svc.yaml
deploy.sh
View file @
d1cad60
...
...
@@ -9,14 +9,14 @@ DOCKER_REGISTRY=hub.kce.ksyun.com
#########################################
sed_yaml
()
{
echo
"修改image名字"
sed -i s@DOCKER_REGISTRY@
$DOCKER_REGISTRY
@g
sed -i s@IMAGE@
$IMAGE
@g
sed -i s@DOCKER_REGISTRY@
$DOCKER_REGISTRY
@g
`
find -type f -name
"*.yaml"
`
sed -i s@IMAGE@
$IMAGE
@g
`
find -type f -name
"*.yaml"
`
}
################################
recover_yaml
()
{
echo
"恢复yaml模板"
sed -i s@
$DOCKER_REGISTRY
@hub.kce.ksyun.com@g
sed -i s@
$IMAGE
@nginx:latestg
sed -i s@
$DOCKER_REGISTRY
@hub.kce.ksyun.com@g
`
find -type f -name
"*.yaml"
`
sed -i s@
$IMAGE
@nginx:latestg
`
find -type f -name
"*.yaml"
`
}
###################################
delt_all
()
{
...
...
@@ -28,7 +28,6 @@ sed_yaml
kubectl apply -f k8s_yaml
recover_yaml
}
##########################################
redeploy
()
{
...
...
@@ -47,4 +46,3 @@ private)
echo
"please input (redeploy|private)"
esac
k8s_yaml/deployment.yaml
View file @
d1cad60
apiVersion
:
extensions/v1beta1
kind
:
Deployment
metadata
:
name
:
CICD
--frontend
name
:
cicd
--frontend
namespace
:
test
spec
:
replicas
:
1
template
:
metadata
:
labels
:
app
:
CICD
--frontend
app
:
cicd
--frontend
spec
:
nodeSelector
:
internal_service_node
:
"
true"
containers
:
-
name
:
CICD
--frontend
image
:
$DOCKER_REGISTRY/$
IMAGE
-
name
:
cicd
--frontend
image
:
DOCKER_REGISTRY/
IMAGE
imagePullPolicy
:
Always
ports
:
-
containerPort
:
80
...
...
k8s_yaml/svc.yaml
View file @
d1cad60
apiVersion
:
v1
kind
:
Service
metadata
:
name
:
CICD
--frontend
name
:
cicd
--frontend
namespace
:
test
spec
:
type
:
NodePort
selector
:
app
:
CICD
--frontend
app
:
cicd
--frontend
ports
:
-
port
:
80
name
:
port-80
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment