Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
0d177e7
Update HomeController.java
ehok Jul 3, 2019
743714d
Update Dockerfile
ehok Jul 3, 2019
0c6c698
Update Dockerfile
ehok Jul 8, 2019
3332159
Create github-ci.yml
ehok Sep 6, 2019
13fa068
Rename github-ci.yml to github-ci-deneme.yml
ehok Sep 6, 2019
35b1018
Create gazi.yml
ehok Sep 6, 2019
ee4e1f1
Update Dockerfile
ehok Sep 6, 2019
7c2af90
Update HomeController.java
ehok Sep 6, 2019
1056275
Update Dockerfile
ehok Sep 6, 2019
87a3814
Update github-ci-deneme.yml
ehok Sep 6, 2019
6a598ca
Create engincan.yml
ehok Sep 6, 2019
37ed320
Update engincan.yml
ehok Sep 6, 2019
80181c3
Update engincan.yml
ehok Sep 6, 2019
7379a4c
Update engincan.yml
ehok Sep 6, 2019
3ec60c6
Update engincan.yml
ehok Sep 6, 2019
39b1c76
Create amuniym.yml
ehok Sep 6, 2019
36e8eac
Update amuniym.yml
ehok Sep 6, 2019
dcc94bf
Delete engincan.yml
ehok Sep 6, 2019
daa5cbe
Delete gazi.yml
ehok Sep 6, 2019
14f67fb
Delete github-ci-deneme.yml
ehok Sep 6, 2019
5894cf8
Delete github-ci.yml
ehok Sep 6, 2019
e541fbb
Update amuniym.yml
ehok Sep 6, 2019
c5552e6
Update amuniym.yml
ehok Sep 6, 2019
e10fb65
Update amuniym.yml
ehok Sep 6, 2019
a052034
Update amuniym.yml
ehok Sep 6, 2019
a1aa7e5
Update Dockerfile
ehok Sep 6, 2019
349ec1e
Update amuniym.yml
ehok Sep 6, 2019
62c1305
Update amuniym.yml
ehok Sep 6, 2019
95ec477
Update amuniym.yml
ehok Sep 6, 2019
df3e169
Update amuniym.yml
ehok Sep 6, 2019
630b6c7
Update amuniym.yml
ehok Sep 6, 2019
6927470
Update amuniym.yml
ehok Sep 6, 2019
9c2fcca
Update amuniym.yml
ehok Sep 6, 2019
91f7cf0
Update amuniym.yml
ehok Sep 6, 2019
2169b74
Update amuniym.yml
ehok Sep 6, 2019
b82d9f5
Update amuniym.yml
ehok Sep 6, 2019
aeef994
Update amuniym.yml
ehok Sep 6, 2019
436b658
Update amuniym.yml
ehok Sep 6, 2019
84e3da6
Update amuniym.yml
ehok Sep 6, 2019
4505a97
Update amuniym.yml
ehok Sep 6, 2019
da9363c
Update amuniym.yml
ehok Sep 6, 2019
5dab03d
Update amuniym.yml
ehok Sep 6, 2019
5d42c92
Update amuniym.yml
ehok Sep 16, 2019
7317027
Update amuniym.yml
ehok Sep 16, 2019
c0eb712
Create denemee.yml
ehok Sep 16, 2019
0c6cd23
helm chart added
bcfmmert Sep 16, 2019
5dcc248
Update amuniym.yml
ehok Sep 16, 2019
cfcc128
Update amuniym.yml
ehok Sep 17, 2019
7469eea
Create config
ehok Sep 18, 2019
b82b05b
Update amuniym.yml
ehok Sep 18, 2019
720449e
Update amuniym.yml
ehok Sep 18, 2019
27f6f9a
Update amuniym.yml
ehok Sep 18, 2019
afb94bc
Update amuniym.yml
ehok Sep 18, 2019
c760816
Update config
ehok Sep 18, 2019
5237015
Delete denemee.yml
ehok Sep 19, 2019
30b05cd
Update amuniym.yml
ehok Sep 20, 2019
af466d1
Update amuniym.yml
ehok Sep 22, 2019
664a07b
Update amuniym.yml
ehok Sep 22, 2019
24967b1
Update amuniym.yml
ehok Sep 22, 2019
775dfa1
Update amuniym.yml
ehok Sep 22, 2019
ff8f465
Update amuniym.yml
ehok Sep 22, 2019
4c309d1
Update HomeController.java
ehok Oct 9, 2019
46caa8a
Update Dockerfile
ehok Oct 16, 2019
69ddfaf
Update amuniym.yml
ehok Nov 6, 2019
f511cc3
Update amuniym.yml
ehok Nov 6, 2019
da68af2
Update amuniym.yml
ehok Nov 6, 2019
6d8f396
Update amuniym.yml
ehok Nov 6, 2019
4e712e0
Create pub
ehok Jan 27, 2020
72a100f
Delete pub
ehok Jan 27, 2020
40bf290
Update HomeControllerTest.java
ehok Dec 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/amuniym.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Amuniym CI

on:
push:
branches:
- master
- 'releases/*'
tags:
- v1.0
jobs:
build:

runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v1
- name: Docker Login
run: docker login -u ${{ secrets.USERNAME }} -p ${{ secrets.PASSWORD }}
shell: bash
- name: Docker Image Build
run: docker image build -t engincanhoke/githubci:latest .
shell: bash
- name: Docker Image Push
run: docker push engincanhoke/githubci:latest
shell: bash
- name: Installations
run: |
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
sudo apt-get update && sudo apt-get install google-cloud-sdk && \
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
sudo mv ./kubectl /usr/local/bin/kubectl && \
curl -L https://git.io/get_helm.sh | bash && \
echo ${{ secrets.DEPLOYER }} | base64 --decode > deployer.json && \
gcloud auth activate-service-account ${{ secrets.SERVICEACCOUNT }} --key-file=$(pwd)/deployer.json --project=${{ secrets.PROJECTNAME }} && \
gcloud container clusters get-credentials ${{ secrets.CLUSTERNAME }} --zone ${{ secrets.ZONE }} && \
helm init --client-only


shell: bash
- name: Helm deploy
run: helm upgrade --install helloworld hello-world --namespace application --set image.tag="latest"
20 changes: 7 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
FROM dockerfile/java:oracle-java8

ENV MAVEN_VERSION 3.2.5

RUN curl -sSL http://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - -C /usr/share \
&& mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

ENV MAVEN_HOME /usr/share/maven

FROM maven:3-jdk-8-alpine as builder

COPY . /data/springboot-helloworld
WORKDIR /data/springboot-helloworld
RUN ["mvn", "clean", "install", "-Dmaven.test.skip=true"]

RUN ["mvn", "clean", "install"]
FROM openjdk:8-alpine

WORKDIR /data
COPY --from=builder /data/springboot-helloworld/target/*.jar ./app.jar
EXPOSE 8080

CMD ["java", "-jar", "target/helloworld-0.0.1-SNAPSHOT.jar"]
CMD ["java", "-jar", "app.jar"]
26 changes: 26 additions & 0 deletions config
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURDekNDQWZPZ0F3SUJBZ0lRSWFCYW1lNmJoTGFLY0taazBvMEpDREFOQmdrcWhraUc5dzBCQVFzRkFEQXYKTVMwd0t3WURWUVFERXlSaVlXRXdaRGxtWWkwd1l6TmtMVFF3WVdNdFlXRTFPUzB6TkRneVlXUTFOV00xTXpjdwpIaGNOTVRrd09UQTJNVEl4TmpBeVdoY05NalF3T1RBME1UTXhOakF5V2pBdk1TMHdLd1lEVlFRREV5UmlZV0V3ClpEbG1ZaTB3WXpOa0xUUXdZV010WVdFMU9TMHpORGd5WVdRMU5XTTFNemN3Z2dFaU1BMEdDU3FHU0liM0RRRUIKQVFVQUE0SUJEd0F3Z2dFS0FvSUJBUURYYTUvWE11c1NIRmQ2UTF1bm5WZ3dqS0NYVGlVZ0t2OHBKUktsYVNxdgowdXFXMjZEMFprVXRHYUxxWDBvWTB5TlJMTGpZRGRxWG9ZSEJNZllhUEY5NzlmTVFzSEJzYjdnWmZZTHQyR0ZDCi9za0htUFI2SXQya25DR3RIQ2lZSUNCdDRSYmZUb0VqNDNiSzdGd3pmdE9uNkl0dmRudmZBMnl4UmxSRjg1RmEKVW5vSzk3U29wdUtIa2FhR1NBeGxGb1pIb1VicnpRalI3ZTVlN2dEWW8zZUdTNjdIZ01NUWVsbFhuNFkvUDRRQQppRnFDMU5OYWRsaE9MZ01jMjJhWHFJM3E4Tngrblp1UHcwUUhjUXJONVVaVU9nQitxb0w4ZWFJYkJtRGF2RFFrCnNyN3lzdDgrUEFRR3U5V0lGaDMyMjBtV012M2Q5ajR2aSt3ZVZiSmM0dllIQWdNQkFBR2pJekFoTUE0R0ExVWQKRHdFQi93UUVBd0lDQkRBUEJnTlZIUk1CQWY4RUJUQURBUUgvTUEwR0NTcUdTSWIzRFFFQkN3VUFBNElCQVFEUQozaGlvdHROVEVDZWpFdjQvd1d0N3J4cXhTVWFsNTV5azJUUUlpc2dVOEp4NTErWVZTc1lob1FCZTlla2xFV1lmClIweEV6bm1nUzhhZGJJYktkTFViSXU0K3E1aksyM2hYUHNtOXM1aHQvWXYzRnhKMFVUV2ZnbVhYTlgzNTVuMWkKcERxMkM0MkZFZHREaFhFQVJQR3NQOUcrQ0tEazlhcDFjOE1aNzhBd1RtSkppWnJQWEI2SjZuMWY4L2UzdWxydQptKzlvc3FmOTR0dFgwaU9sNThaNDhCdmtGa1IvOEdxakxSK0pic1VoL0NySzg1aTVEL2cyd0ZxR1NjR2JKNUhWClFOQ0dPTFdGczdkZmZZQTZsUzRKSmNseU82TnAvdm9lUCtReENkdFNVb0dOVlE5NDhINSs1VWFJNlFJamxsazMKRnNrUWVuaCtxNFlPM25iekJGa3cKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
server: https://35.228.176.115
name: gke_axial-history-248207_europe-north1-b_standard-cluster-1
contexts:
- context:
cluster: gke_axial-history-248207_europe-north1-b_standard-cluster-1
user: gke_axial-history-248207_europe-north1-b_standard-cluster-1
name: gke_axial-history-248207_europe-north1-b_standard-cluster-1
current-context: gke_axial-history-248207_europe-north1-b_standard-cluster-1
kind: Config
preferences: {}
users:
- name: gke_axial-history-248207_europe-north1-b_standard-cluster-1
user:
auth-provider:
config:
access-token: ya29.Il-HB4_VLKYnVHUWOi9qv3UNuqWu49ROQvN_Efiy4P2v8K8oDf02kxfeOCRPMUan6S8hsVXjFn5warL4wM3shgkmOTvA6HbYqqEMACAZKs-29mnOCJrXsaBQKP5d3QegDw
cmd-args: config config-helper --format=json
cmd-path: /usr/lib64/google-cloud-sdk/bin/gcloud
expiry: "2019-09-18T15:49:06Z"
expiry-key: '{.credential.token_expiry}'
token-key: '{.credential.access_token}'
name: gcp
22 changes: 22 additions & 0 deletions hello-world/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 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/
5 changes: 5 additions & 0 deletions hello-world/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: hello-world
version: 0.1.0
21 changes: 21 additions & 0 deletions hello-world/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.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 "hello-world.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 --namespace {{ .Release.Namespace }} svc -w {{ include "hello-world.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "hello-world.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 "hello-world.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 }}
45 changes: 45 additions & 0 deletions hello-world/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "hello-world.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 "hello-world.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 "hello-world.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "hello-world.labels" -}}
app.kubernetes.io/name: {{ include "hello-world.name" . }}
helm.sh/chart: {{ include "hello-world.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
50 changes: 50 additions & 0 deletions hello-world/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "hello-world.fullname" . }}
labels:
{{ include "hello-world.labels" . | indent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "hello-world.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "hello-world.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
imagePullSecrets:
- name: myregistrykey
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
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 }}
36 changes: 36 additions & 0 deletions hello-world/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "hello-world.fullname" . -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{ include "hello-world.labels" . | indent 4 }}
{{- 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: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- end }}
{{- end }}
16 changes: 16 additions & 0 deletions hello-world/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "hello-world.fullname" . }}
labels:
{{ include "hello-world.labels" . | indent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: {{ include "hello-world.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
15 changes: 15 additions & 0 deletions hello-world/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "hello-world.fullname" . }}-test-connection"
labels:
{{ include "hello-world.labels" . | indent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "hello-world.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
51 changes: 51 additions & 0 deletions hello-world/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Default values for hello-world.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 2

image:
repository: mertongngl/hello
tag: latest
pullPolicy: IfNotPresent

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

service:
type: ClusterIP
port: 80

ingress:
enabled: true
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: mertcase.bestcloudfor.me
paths:
- "/"

tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

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: {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class HomeController {

@RequestMapping("/")
String home() {
return "Hello from GazGeek!";
return "Hello from Engin!";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class HomeControllerTest {
public void helloWorld() {
getRequest("/")
.assertStatusCode(OK)
.assertResponseBody("Hello from GazGeek!");
.assertResponseBody("Hello from Engin!");
}

private HelloWorldResponse getRequest(String uri) {
Expand Down