pax_global_header 0000666 0000000 0000000 00000000064 13460567644 0014531 g ustar 00root root 0000000 0000000 52 comment=7d36d5653621f444f32b1bf30be2b158df08f5ad
ssa-master/ 0000775 0000000 0000000 00000000000 13460567644 0013154 5 ustar 00root root 0000000 0000000 ssa-master/.gitignore 0000664 0000000 0000000 00000000414 13460567644 0015143 0 ustar 00root root 0000000 0000000 /target/
!.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/ ssa-master/.gitlab-ci.yml 0000664 0000000 0000000 00000001660 13460567644 0015613 0 ustar 00root root 0000000 0000000 variables:
RELEASE_NAME: "project3057"
SERVICE_PORT: 1099
REGISTRY_URL: 751503455312.dkr.ecr.us-west-2.amazonaws.com/pgnonprod
stages:
- Build
- Test
- ReleaseCleanup
- ReleaseDeploy
Build:
stage: Build
script:
- mvn clean install
- $(aws ecr get-login --no-include-email --region us-west-2)
- docker build -t 751503455312.dkr.ecr.us-west-2.amazonaws.com/pgnonprod:$CI_PIPELINE_ID .
- docker push 751503455312.dkr.ecr.us-west-2.amazonaws.com/pgnonprod:$CI_PIPELINE_ID
ReleaseCleanup:
stage: ReleaseCleanup
script:
- echo `pwd`
- cd ./helm && /sbin/helm delete --purge $RELEASE_NAME && exit 0
allow_failure: true
ReleaseDeploy:
stage: ReleaseDeploy
script:
- echo `pwd`
- 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
- cd ./helm && /sbin/helm install service --name $RELEASE_NAME ssa-master/Dockerfile 0000664 0000000 0000000 00000000171 13460567644 0015145 0 ustar 00root root 0000000 0000000 FROM openjdk:8-jre-alpine
ADD /target/demo-0.0.1-SNAPSHOT.jar //
ENTRYPOINT ["java", "-jar", "/demo-0.0.1-SNAPSHOT.jar"]
ssa-master/README.md 0000664 0000000 0000000 00000000017 13460567644 0014431 0 ustar 00root root 0000000 0000000 # k8-test-svc
ssa-master/helm/ 0000775 0000000 0000000 00000000000 13460567644 0014101 5 ustar 00root root 0000000 0000000 ssa-master/helm/service/ 0000775 0000000 0000000 00000000000 13460567644 0015541 5 ustar 00root root 0000000 0000000 ssa-master/helm/service/.helmignore 0000664 0000000 0000000 00000000526 13460567644 0017676 0 ustar 00root root 0000000 0000000 # Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
ssa-master/helm/service/Chart.yaml 0000664 0000000 0000000 00000000152 13460567644 0017464 0 ustar 00root root 0000000 0000000 apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: project3057
version: 0.1.0 ssa-master/helm/service/templates/ 0000775 0000000 0000000 00000000000 13460567644 0017537 5 ustar 00root root 0000000 0000000 ssa-master/helm/service/templates/NOTES.txt 0000664 0000000 0000000 00000002734 13460567644 0021176 0 ustar 00root root 0000000 0000000 1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range $.Values.ingress.paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "project3057.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ include "project3057.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "project3057.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "project3057.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"
kubectl port-forward $POD_NAME 8080:80
{{- end }} ssa-master/helm/service/templates/_helpers.tpl 0000664 0000000 0000000 00000002040 13460567644 0022055 0 ustar 00root root 0000000 0000000 {{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "project3057.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "project3057.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "project3057.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}} ssa-master/helm/service/templates/deployment.yaml 0000664 0000000 0000000 00000002602 13460567644 0022603 0 ustar 00root root 0000000 0000000 apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "project3057.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "project3057.name" . }}
helm.sh/chart: {{ include "project3057.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "project3057.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "project3057.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.internalport }}
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }} ssa-master/helm/service/templates/ingress.yaml 0000664 0000000 0000000 00000002044 13460567644 0022075 0 ustar 00root root 0000000 0000000 {{- if .Values.ingress.enabled -}}
{{- $fullName := include "project3057.fullname" . -}}
{{- $ingressPaths := .Values.ingress.paths -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "project3057.name" . }}
helm.sh/chart: {{ include "project3057.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
http:
paths:
{{- range $ingressPaths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- end }}
{{- end }} ssa-master/helm/service/templates/service.yaml 0000664 0000000 0000000 00000001126 13460567644 0022063 0 ustar 00root root 0000000 0000000 apiVersion: v1
kind: Service
metadata:
name: {{ include "project3057.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "project3057.name" . }}
helm.sh/chart: {{ include "project3057.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "project3057.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }} ssa-master/helm/service/templates/tests/ 0000775 0000000 0000000 00000000000 13460567644 0020701 5 ustar 00root root 0000000 0000000 ssa-master/helm/service/templates/tests/test-connection.yaml 0000664 0000000 0000000 00000001074 13460567644 0024703 0 ustar 00root root 0000000 0000000 apiVersion: v1
kind: Pod
metadata:
name: "{{ include "project3057.fullname" . }}-test-connection"
labels:
app.kubernetes.io/name: {{ include "project3057.name" . }}
helm.sh/chart: {{ include "project3057.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "project3057.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never ssa-master/helm/service/values.yaml 0000664 0000000 0000000 00000002425 13460567644 0017727 0 ustar 00root root 0000000 0000000 # Default values for project3057.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: 751503455312.dkr.ecr.us-west-2.amazonaws.com/pgnonprod
tag: #BUILD_ID#
pullPolicy: IfNotPresent
nameOverride: ""
fullnameOverride: ""
service:
type: NodePort
port: 80
internalport: #SERVICE_PORT#
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /
#kubernetes.io/tls-acme: "true"
paths:
path: /project3057
hosts:
# - afe6ec7ed3f3711e9b98006759708723-313212737.us-west-2.elb.amazonaws.com
- pgtest.altimetrik.com
tls:
- secretName: custom-tls-cert
hosts:
- pgtest.altimetrik.com
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {} ssa-master/pom.xml 0000664 0000000 0000000 00000004445 13460567644 0014500 0 ustar 00root root 0000000 0000000
4.0.0
org.springframework.boot
spring-boot-starter-parent
2.0.5.RELEASE
com.altimetrik
demo
0.0.1-SNAPSHOT
jar
articles
Demo project for Spring Boot
1.8
org.springframework.boot
spring-boot-starter
com.h2database
h2
runtime
org.springframework.boot
spring-boot-starter-test
test
org.springframework.boot
spring-boot-starter-web
io.swagger
swagger-annotations
1.5.20
io.springfox
springfox-swagger2
2.8.0
compile
io.springfox
springfox-swagger-ui
2.8.0
compile
org.springframework.boot
spring-boot-devtools
true
org.springframework.boot
spring-boot-maven-plugin
ssa-master/project.json 0000664 0000000 0000000 00000000147 13460567644 0015517 0 ustar 00root root 0000000 0000000 {
"description" : "Maven structured base project with CICD integrated",
"default_interface" : "API"
} ssa-master/src/ 0000775 0000000 0000000 00000000000 13460567644 0013743 5 ustar 00root root 0000000 0000000 ssa-master/src/main/ 0000775 0000000 0000000 00000000000 13460567644 0014667 5 ustar 00root root 0000000 0000000 ssa-master/src/main/java/ 0000775 0000000 0000000 00000000000 13460567644 0015610 5 ustar 00root root 0000000 0000000 ssa-master/src/main/java/com/ 0000775 0000000 0000000 00000000000 13460567644 0016366 5 ustar 00root root 0000000 0000000 ssa-master/src/main/java/com/altimetrik/ 0000775 0000000 0000000 00000000000 13460567644 0020533 5 ustar 00root root 0000000 0000000 ssa-master/src/main/java/com/altimetrik/Application.java 0000664 0000000 0000000 00000000725 13460567644 0023645 0 ustar 00root root 0000000 0000000 package com.altimetrik;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
@SpringBootApplication
@EnableAsync
public class Application {
public static void main(String[] args) {
System.out.println("App started...miami demo - day 2 Welcome to Articles Publishing Service.");
SpringApplication.run(Application.class, args);
}
}
ssa-master/src/main/java/com/altimetrik/config/ 0000775 0000000 0000000 00000000000 13460567644 0022000 5 ustar 00root root 0000000 0000000 ssa-master/src/main/java/com/altimetrik/config/SwaggerConfig.java 0000664 0000000 0000000 00000003207 13460567644 0025372 0 ustar 00root root 0000000 0000000 /**
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
*/
package com.altimetrik.config;
import static springfox.documentation.builders.PathSelectors.regex;
import java.util.Collections;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
*
* @author MMelavanki
*
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
// Production closes swagger
private boolean enableSwagger=true;
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.basePackage("com.altimetrik.controllers")).paths(regex("/.*")).build()
.enable(enableSwagger).apiInfo(metaData());
}
private ApiInfo metaData() {
return new ApiInfo("Playground Application", "Playground API Services", "2.0",
"https://www.altimetrik.com/privacy-policy/", new Contact("Playground", "https://playground.altimetrik.com", "pg-mgr1@altimetrik.com"),
"Apache License Version 2.0", "https://www.apache.org/licenses/LICENSE-2.0", Collections.emptyList());
}
}
ssa-master/src/main/java/com/altimetrik/controllers/ 0000775 0000000 0000000 00000000000 13460567644 0023101 5 ustar 00root root 0000000 0000000 ssa-master/src/main/java/com/altimetrik/controllers/Hello.java 0000664 0000000 0000000 00000001256 13460567644 0025013 0 ustar 00root root 0000000 0000000 package com.altimetrik.controllers;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/hello")
public class Hello {
@GetMapping(value = "/", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.ALL_VALUE)
public ResponseEntity getUserDetailByGitlabEmailId() {
return new ResponseEntity<>("Wecome to Playground...Java-007", HttpStatus.OK);
}
}
ssa-master/src/main/resources/ 0000775 0000000 0000000 00000000000 13460567644 0016701 5 ustar 00root root 0000000 0000000 ssa-master/src/main/resources/application.properties 0000664 0000000 0000000 00000000000 13460567644 0023310 0 ustar 00root root 0000000 0000000 ssa-master/src/main/resources/application.yml 0000664 0000000 0000000 00000001020 13460567644 0021720 0 ustar 00root root 0000000 0000000 # Spring properties
spring:
application:
name: article # Service registers under this name
freemarker:
enabled: false # Ignore Eureka dashboard FreeMarker templates
# HTTP Server
server:
port: 1099 # HTTP (Tomcat) port
undertow:
accesslog:
enabled: true
# Logging configurations
logging:
level:
root: INFO
com.memorynotfound: DEBUG
org.springframework.web: INFO
org.springframework.security: INFO
org.hibernate.SQL: WARN
article:
fileName : validator.json ssa-master/src/main/resources/validator.json 0000664 0000000 0000000 00000001457 13460567644 0021570 0 ustar 00root root 0000000 0000000 [
{
"id": 1,
"title": "SAMPLE APPLICATION",
"description": "It is a Sample Demo Application",
"tags": [
"JAVA",
"SPRING"
],
"vote": 1,
"createdBy": "ssa3410@altimetrik.com",
"createdDate": "01-12-2018",
"updatedBy": null,
"updatedDate": null
},
{
"id": 2,
"title": "secod APPLICATION",
"description": "It is a Sample Demo Application",
"tags": [
"JAVA",
"SPRING"
],
"vote": 2,
"createdDate": "01-12-2018",
"createdBy": "ssa3410@altimetrik.com",
"updatedDate": null,
"updatedBy": null
},
{
"id": 3,
"title": "secod APPLICATION",
"description": "It is a Sample Demo Application",
"tags": [
"JAVA",
"SPRING"
],
"vote": 0,
"createdDate": "01-12-2018",
"createdBy": "ssa3410@altimetrik.com",
"updatedDate": null,
"updatedBy": null
}
]
ssa-master/src/test/ 0000775 0000000 0000000 00000000000 13460567644 0014722 5 ustar 00root root 0000000 0000000 ssa-master/src/test/java/ 0000775 0000000 0000000 00000000000 13460567644 0015643 5 ustar 00root root 0000000 0000000 ssa-master/src/test/java/com/ 0000775 0000000 0000000 00000000000 13460567644 0016421 5 ustar 00root root 0000000 0000000 ssa-master/src/test/java/com/altimetrik/ 0000775 0000000 0000000 00000000000 13460567644 0020566 5 ustar 00root root 0000000 0000000 ssa-master/src/test/java/com/altimetrik/ArticlesApplicationTests.java 0000664 0000000 0000000 00000000515 13460567644 0026407 0 ustar 00root root 0000000 0000000 package com.altimetrik;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ArticlesApplicationTests {
@Test
public void contextLoads() {
}
}