Commit 5130954f authored by nmuthusamy's avatar nmuthusamy

initial commit

parent ad1165ef
variables: variables:
RELEASE_NAME: "SERVICE_NAME" RELEASE_NAME: "SERVICE_NAME"
SERVICE_PORT: 1099 SERVICE_PORT: 1099
REGISTRY_URL: 279716074232.dkr.ecr.us-east-1.amazonaws.com/pgdockrepo REGISTRY_URL: 751503455312.dkr.ecr.us-west-2.amazonaws.com/pgnonprod
SONAR_URL: "http://pg-sonar-altimetrik-com-82028342.us-west-2.elb.amazonaws.com"
SONAR_LOGIN: "cc3fc35cad01a325d1b3904bcf3aa38b153fa7f1"
stages: stages:
- Build - Build
...@@ -17,20 +15,17 @@ Build: ...@@ -17,20 +15,17 @@ Build:
stage: Build stage: Build
script: script:
- mvn clean install - mvn clean install
- $(aws ecr get-login --no-include-email --region us-east-1) - $(aws ecr get-login --no-include-email --region us-west-2)
- docker build -t 279716074232.dkr.ecr.us-east-1.amazonaws.com/pgdockrepo:$CI_PIPELINE_ID . - docker build -t 751503455312.dkr.ecr.us-west-2.amazonaws.com/pgnonprod:$CI_PIPELINE_ID .
- docker push 279716074232.dkr.ecr.us-east-1.amazonaws.com/pgdockrepo:$CI_PIPELINE_ID - docker push 751503455312.dkr.ecr.us-west-2.amazonaws.com/pgnonprod:$CI_PIPELINE_ID
sonar:
stage: Test
script:
- mvn --batch-mode verify sonar:sonar -Dsonar.exclusions="pom.xml" -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN
ReleaseCleanup: ReleaseCleanup:
stage: ReleaseCleanup stage: ReleaseCleanup
script: script:
- echo `pwd` - echo `pwd`
- cd ./helm && /usr/local/bin/helm delete --purge $RELEASE_NAME && exit 0 - cd ./helm && /sbin/helm delete --purge $RELEASE_NAME && exit 0
allow_failure: true allow_failure: true
...@@ -40,4 +35,4 @@ ReleaseDeploy: ...@@ -40,4 +35,4 @@ ReleaseDeploy:
- echo `pwd` - echo `pwd`
- sed -i s/#BUILD_ID#/$CI_PIPELINE_ID/g ./helm/service/values.yaml - sed -i s/#BUILD_ID#/$CI_PIPELINE_ID/g ./helm/service/values.yaml
- sed -i s/#SERVICE_PORT#/$SERVICE_PORT/g ./helm/service/values.yaml - sed -i s/#SERVICE_PORT#/$SERVICE_PORT/g ./helm/service/values.yaml
- cd ./helm && /usr/local/bin/helm install service --name $RELEASE_NAME - cd ./helm && /sbin/helm install service --name $RELEASE_NAME
\ No newline at end of file \ No newline at end of file
...@@ -2,4 +2,4 @@ apiVersion: v1 ...@@ -2,4 +2,4 @@ apiVersion: v1
appVersion: "1.0" appVersion: "1.0"
description: A Helm chart for Kubernetes description: A Helm chart for Kubernetes
name: SERVICE_NAME name: SERVICE_NAME
version: 0.1.0 version: 0.1.0
\ No newline at end of file
...@@ -18,4 +18,4 @@ ...@@ -18,4 +18,4 @@
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "SERVICE_NAME.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "SERVICE_NAME.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application" echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80 kubectl port-forward $POD_NAME 8080:80
{{- end }} {{- end }}
\ No newline at end of file
...@@ -29,4 +29,4 @@ Create chart name and version as used by the chart label. ...@@ -29,4 +29,4 @@ Create chart name and version as used by the chart label.
*/}} */}}
{{- define "SERVICE_NAME.chart" -}} {{- define "SERVICE_NAME.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
\ No newline at end of file
...@@ -40,4 +40,4 @@ spec: ...@@ -40,4 +40,4 @@ spec:
{{- with .Values.tolerations }} {{- with .Values.tolerations }}
tolerations: tolerations:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
\ No newline at end of file
...@@ -37,4 +37,4 @@ spec: ...@@ -37,4 +37,4 @@ spec:
servicePort: http servicePort: http
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
\ No newline at end of file
...@@ -16,4 +16,4 @@ spec: ...@@ -16,4 +16,4 @@ spec:
name: http name: http
selector: selector:
app.kubernetes.io/name: {{ include "SERVICE_NAME.name" . }} app.kubernetes.io/name: {{ include "SERVICE_NAME.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
\ No newline at end of file
...@@ -15,4 +15,4 @@ spec: ...@@ -15,4 +15,4 @@ spec:
image: busybox image: busybox
command: ['wget'] command: ['wget']
args: ['{{ include "SERVICE_NAME.fullname" . }}:{{ .Values.service.port }}'] args: ['{{ include "SERVICE_NAME.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never restartPolicy: Never
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
replicaCount: 1 replicaCount: 1
image: image:
repository: 279716074232.dkr.ecr.us-east-1.amazonaws.com/pgdockrepo repository: 751503455312.dkr.ecr.us-west-2.amazonaws.com/pgnonprod
tag: #BUILD_ID# tag: #BUILD_ID#
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
...@@ -13,22 +13,26 @@ nameOverride: "" ...@@ -13,22 +13,26 @@ nameOverride: ""
fullnameOverride: "" fullnameOverride: ""
service: service:
type: LoadBalancer type: NodePort
port: 80 port: 80
internalport: #SERVICE_PORT# internalport: #SERVICE_PORT#
ingress: ingress:
enabled: false enabled: true
annotations: {} annotations:
# kubernetes.io/ingress.class: nginx kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true" nginx.ingress.kubernetes.io/rewrite-target: /
paths: [] #kubernetes.io/tls-acme: "true"
paths:
path: /SERVICE_NAME
hosts: hosts:
- chart-example.local # - afe6ec7ed3f3711e9b98006759708723-313212737.us-west-2.elb.amazonaws.com
tls: [] - pgtest.altimetrik.com
# - secretName: chart-example-tls
# hosts: tls:
# - chart-example.local - secretName: custom-tls-cert
hosts:
- pgtest.altimetrik.com
resources: {} resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious # We usually recommend not to specify default resources and to leave this as a conscious
...@@ -46,4 +50,4 @@ nodeSelector: {} ...@@ -46,4 +50,4 @@ nodeSelector: {}
tolerations: [] tolerations: []
affinity: {} affinity: {}
\ No newline at end of file
...@@ -11,10 +11,10 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -11,10 +11,10 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping(value = "/hello") @RequestMapping(value = "/hello")
public class Hello { public class Hello {
@GetMapping(value = "/", produces = MediaType.APPLICATION_JSON_VALUE) @GetMapping(value = "/", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.ALL_VALUE)
public ResponseEntity<String> getMessage() { public ResponseEntity<String> getUserDetailByGitlabEmailId() {
System.out.println("Inside first API");
return new ResponseEntity<>("Wecome to Playground...", HttpStatus.OK); return new ResponseEntity<>("Wecome to Playground...Java-007", HttpStatus.OK);
} }
......
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