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
...
@@ -9,14 +9,14 @@ DOCKER_REGISTRY=hub.kce.ksyun.com
#########################################
#########################################
sed_yaml
()
{
sed_yaml
()
{
echo
"修改image名字"
echo
"修改image名字"
sed -i s@DOCKER_REGISTRY@
$DOCKER_REGISTRY
@g
sed -i s@DOCKER_REGISTRY@
$DOCKER_REGISTRY
@g
`
find -type f -name
"*.yaml"
`
sed -i s@IMAGE@
$IMAGE
@g
sed -i s@IMAGE@
$IMAGE
@g
`
find -type f -name
"*.yaml"
`
}
}
################################
################################
recover_yaml
()
{
recover_yaml
()
{
echo
"恢复yaml模板"
echo
"恢复yaml模板"
sed -i s@
$DOCKER_REGISTRY
@hub.kce.ksyun.com@g
sed -i s@
$DOCKER_REGISTRY
@hub.kce.ksyun.com@g
`
find -type f -name
"*.yaml"
`
sed -i s@
$IMAGE
@nginx:latestg
sed -i s@
$IMAGE
@nginx:latestg
`
find -type f -name
"*.yaml"
`
}
}
###################################
###################################
delt_all
()
{
delt_all
()
{
...
@@ -28,7 +28,6 @@ sed_yaml
...
@@ -28,7 +28,6 @@ sed_yaml
kubectl apply -f k8s_yaml
kubectl apply -f k8s_yaml
recover_yaml
recover_yaml
}
}
##########################################
##########################################
redeploy
()
redeploy
()
{
{
...
@@ -47,4 +46,3 @@ private)
...
@@ -47,4 +46,3 @@ private)
echo
"please input (redeploy|private)"
echo
"please input (redeploy|private)"
esac
esac
k8s_yaml/deployment.yaml
View file @
d1cad60
apiVersion
:
extensions/v1beta1
apiVersion
:
extensions/v1beta1
kind
:
Deployment
kind
:
Deployment
metadata
:
metadata
:
name
:
CICD
--frontend
name
:
cicd
--frontend
namespace
:
test
namespace
:
test
spec
:
spec
:
replicas
:
1
replicas
:
1
template
:
template
:
metadata
:
metadata
:
labels
:
labels
:
app
:
CICD
--frontend
app
:
cicd
--frontend
spec
:
spec
:
nodeSelector
:
nodeSelector
:
internal_service_node
:
"
true"
internal_service_node
:
"
true"
containers
:
containers
:
-
name
:
CICD
--frontend
-
name
:
cicd
--frontend
image
:
$DOCKER_REGISTRY/$
IMAGE
image
:
DOCKER_REGISTRY/
IMAGE
imagePullPolicy
:
Always
imagePullPolicy
:
Always
ports
:
ports
:
-
containerPort
:
80
-
containerPort
:
80
...
...
k8s_yaml/svc.yaml
View file @
d1cad60
apiVersion
:
v1
apiVersion
:
v1
kind
:
Service
kind
:
Service
metadata
:
metadata
:
name
:
CICD
--frontend
name
:
cicd
--frontend
namespace
:
test
namespace
:
test
spec
:
spec
:
type
:
NodePort
type
:
NodePort
selector
:
selector
:
app
:
CICD
--frontend
app
:
cicd
--frontend
ports
:
ports
:
-
port
:
80
-
port
:
80
name
:
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