builds
This commit is contained in:
@@ -26,56 +26,13 @@ steps:
|
|||||||
docker push gcr.io/$PROJECT_ID/$_PROJECT_NAME:$COMMIT_SHA
|
docker push gcr.io/$PROJECT_ID/$_PROJECT_NAME:$COMMIT_SHA
|
||||||
### deploy
|
### deploy
|
||||||
- id: 'deploy'
|
- id: 'deploy'
|
||||||
name: 'gcr.io/cloud-builders/gcloud'
|
name: "gcr.io/cloud-builders/gke-deploy"
|
||||||
entrypoint: 'bash'
|
|
||||||
args:
|
args:
|
||||||
- '-c'
|
- run
|
||||||
- |
|
- --filename=deployment.yaml
|
||||||
PROJECT=$$(gcloud config get-value core/project)
|
- --image=gcr.io/$PROJECT_ID/$_PROJECT_NAME:$COMMIT_SHA
|
||||||
gcloud container clusters get-credentials "$${CLOUDSDK_CONTAINER_CLUSTER}" \
|
- --location=asia-northeast1-a
|
||||||
--project "$${PROJECT}" \
|
- --cluster=cluster-1
|
||||||
--zone "$${CLOUDSDK_COMPUTE_ZONE}"
|
|
||||||
|
|
||||||
cat <<EOF | kubectl apply -f -
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: $_PROJECT_NAME
|
|
||||||
labels:
|
|
||||||
app: $_PROJECT_NAME
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 8080
|
|
||||||
targetPort: 8080
|
|
||||||
selector:
|
|
||||||
app: $_PROJECT_NAME
|
|
||||||
type:
|
|
||||||
LoadBalancer
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF | kubectl apply -f -
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: $_PROJECT_NAME
|
|
||||||
labels:
|
|
||||||
app: $_PROJECT_NAME
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: $_PROJECT_NAME
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: $_PROJECT_NAME
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: $_PROJECT_NAME
|
|
||||||
image: gcr.io/$PROJECT_ID/$_PROJECT_NAME:$COMMIT_SHA
|
|
||||||
ports:
|
|
||||||
- containerPort: 8080
|
|
||||||
EOF
|
|
||||||
substitutions:
|
substitutions:
|
||||||
_PROJECT_NAME: gateway
|
_PROJECT_NAME: gateway
|
||||||
options:
|
options:
|
||||||
|
|||||||
21
kubernetes/deployment.yaml
Normal file
21
kubernetes/deployment.yaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: gateway
|
||||||
|
labels:
|
||||||
|
app: gateway
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: gateway
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: gateway
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: gateway
|
||||||
|
image: gcr.io/st-mall/gateway
|
||||||
|
ports:
|
||||||
|
- containerPort: 8080
|
||||||
14
kubernetes/service.yaml
Normal file
14
kubernetes/service.yaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: gateway
|
||||||
|
labels:
|
||||||
|
app: gateway
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 8080
|
||||||
|
targetPort: 8080
|
||||||
|
selector:
|
||||||
|
app: gateway
|
||||||
|
type:
|
||||||
|
LoadBalancer
|
||||||
Reference in New Issue
Block a user