Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
AIT
biovalidator
Commits
0eafaf8e
Commit
0eafaf8e
authored
Dec 14, 2020
by
Dipayan Gupta
Browse files
Fix the k8 deployment
parent
619eed5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
0 deletions
+75
-0
gitlab-ci.yml
gitlab-ci.yml
+37
-0
k8s-deployment.yaml
k8s-deployment.yaml
+38
-0
No files found.
gitlab-ci.yml
0 → 100644
View file @
0eafaf8e
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
k8s-deployment.yaml
0 → 100644
View file @
0eafaf8e
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
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