Commit 0eafaf8e authored by Dipayan Gupta's avatar Dipayan Gupta
Browse files

Fix the k8 deployment

parent 619eed5b
variables:
GIT_STRATEGY: clone
DOCKER_DRIVER: overlay2
CONTAINER_BUILD_IMAGE: build:latest
CONTAINER_RUNTIME_IMAGE: runtime
DOCKER_TLS_CERTDIR: ""
stages:
- build
- deploy
build_docker_image:
image: docker:latest
services:
- docker:dind
stage: build
script:
- docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
after_script:
- docker logout ${CI_REGISTRY}
hx-production:
stage: deploy
script:
- sed -i s#%DOCKER_IMAGE%#$CI_REGISTRY_IMAGE\:$CI_COMMIT_TAG#g k8s-deployment.yaml
- export KUBECONFIG=/home/gitlab-runner/.kube/hx-wp-webadmin-01-team-admin && kubectl apply -f k8s-deployment.yaml
only:
- disable
hh-production:
stage: deploy
script:
- sed -i s#%DOCKER_IMAGE%#$CI_REGISTRY_IMAGE\:$CI_COMMIT_TAG#g k8s-deployment.yaml
- export KUBECONFIG=/home/gitlab-runner/.kube/hh-wp-webadmin-01-team-admin && kubectl apply -f k8s-deployment.yaml
only:
- disable
apiVersion: apps/v1
kind: Deployment
metadata:
name: json-schema-validator
namespace: json-schema-validator
spec:
selector:
matchLabels:
app: json-schema-validator
replicas: 1
template:
metadata:
labels:
app: json-schema-validator
spec:
containers:
- name: json-schema-validator
image: %DOCKER_IMAGE%
ports:
- containerPort: 3000
imagePullSecrets:
- name: gitlab
---
kind: Service
apiVersion: v1
metadata:
name: json-schema-validator
namespace: json-schema-validator
spec:
selector:
app: json-schema-validator
ports:
- protocol: TCP
port: 3000
targetPort: 3000
type: NodePort
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment