diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index f9c20863..00000000
--- a/Dockerfile
+++ /dev/null
@@ -1,11 +0,0 @@
-# this is multi stage
-FROM openjdk:11 as base
-WORKDIR /app
-COPY . .
-RUN chmod +x gradlew
-RUN ./gradlew build
-
-FROM tomcat:9
-WORKDIR webapps
-COPY --from=base /app/build/libs/sampleWeb-0.0.1-SNAPSHOT.war .
-RUN rm -rf ROOT && mv sampleWeb-0.0.1-SNAPSHOT.war ROOT.war
diff --git a/Jenkinsfile b/Jenkinsfile
deleted file mode 100644
index a2df42b1..00000000
--- a/Jenkinsfile
+++ /dev/null
@@ -1,112 +0,0 @@
-pipeline{
- agent any
- environment{
- VERSION = "${env.BUILD_ID}"
- }
- stages{
- stage("sonar quality check"){
- agent {
- docker {
- image 'openjdk:11'
- }
- }
- steps{
- script{
- withSonarQubeEnv(credentialsId: 'sonar-token') {
- sh 'chmod +x gradlew'
- sh './gradlew sonarqube'
- }
-
- timeout(time: 1, unit: 'HOURS') {
- def qg = waitForQualityGate()
- if (qg.status != 'OK') {
- error "Pipeline aborted due to quality gate failure: ${qg.status}"
- }
- }
-
- }
- }
- }
- stage("docker build & docker push"){
- steps{
- script{
- withCredentials([string(credentialsId: 'docker_pass', variable: 'docker_password')]) {
- sh '''
- docker build -t 34.125.214.226:8083/springapp:${VERSION} .
- docker login -u admin -p $docker_password 34.125.214.226:8083
- docker push 34.125.214.226:8083/springapp:${VERSION}
- docker rmi 34.125.214.226:8083/springapp:${VERSION}
- '''
- }
- }
- }
- }
- stage('indentifying misconfigs using datree in helm charts'){
- steps{
- script{
-
- dir('kubernetes/') {
- withEnv(['DATREE_TOKEN=GJdx2cP2TCDyUY3EhQKgTc']) {
- sh 'helm datree test myapp/'
- }
- }
- }
- }
- }
- stage("pushing the helm charts to nexus"){
- steps{
- script{
- withCredentials([string(credentialsId: 'docker_pass', variable: 'docker_password')]) {
- dir('kubernetes/') {
- sh '''
- helmversion=$( helm show chart myapp | grep version | cut -d: -f 2 | tr -d ' ')
- tar -czvf myapp-${helmversion}.tgz myapp/
- curl -u admin:$docker_password http://34.125.214.226:8081/repository/helm-hosted/ --upload-file myapp-${helmversion}.tgz -v
- '''
- }
- }
- }
- }
- }
-
- stage('manual approval'){
- steps{
- script{
- timeout(10) {
- mail bcc: '', body: "
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Go to build url and approve the deployment request
URL de build: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: '', mimeType: 'text/html', replyTo: '', subject: "${currentBuild.result} CI: Project name -> ${env.JOB_NAME}", to: "deekshith.snsep@gmail.com";
- input(id: "Deploy Gate", message: "Deploy ${params.project_name}?", ok: 'Deploy')
- }
- }
- }
- }
-
- stage('Deploying application on k8s cluster') {
- steps {
- script{
- withCredentials([kubeconfigFile(credentialsId: 'kubernetes-config', variable: 'KUBECONFIG')]) {
- dir('kubernetes/') {
- sh 'helm upgrade --install --set image.repository="34.125.214.226:8083/springapp" --set image.tag="${VERSION}" myjavaapp myapp/ '
- }
- }
- }
- }
- }
-
- stage('verifying app deployment'){
- steps{
- script{
- withCredentials([kubeconfigFile(credentialsId: 'kubernetes-config', variable: 'KUBECONFIG')]) {
- sh 'kubectl run curl --image=curlimages/curl -i --rm --restart=Never -- curl myjavaapp-myapp:8080'
-
- }
- }
- }
- }
- }
-
- post {
- always {
- mail bcc: '', body: "
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
URL de build: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: '', mimeType: 'text/html', replyTo: '', subject: "${currentBuild.result} CI: Project name -> ${env.JOB_NAME}", to: "deekshith.snsep@gmail.com";
- }
- }
-}
diff --git a/JenkinsfileFilter b/JenkinsfileFilter
deleted file mode 100644
index 1c68c70e..00000000
--- a/JenkinsfileFilter
+++ /dev/null
@@ -1,23 +0,0 @@
-pipeline {
- agent {
- docker {
- image 'openjdk:11'
- }
- }
-
- stages {
- stage('Building') {
- steps {
- sh 'chmod +x gradlew'
- sh "./gradlew build | tee output.log"
- }
- }
- stage('Monitoring the logs') {
- steps {
- script {
- sh '! grep "Task" output.log'
- }
- }
- }
- }
-}
diff --git a/JenkinsfileSharedLibrary b/JenkinsfileSharedLibrary
deleted file mode 100644
index ebccd0ae..00000000
--- a/JenkinsfileSharedLibrary
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env groovy
-
-@Library('shared-library@master') _ //master or whatever branch
-
-
-pipeline {
- agent {
- docker {
- image 'openjdk:11'
- }
- }
-
- stages {
- stage('Building') {
- steps {
- sh 'chmod +x gradlew'
- sh "./gradlew build "
- }
- }
- stage ('Check logs') {
- steps {
- filterLogs ('Task', 3)
- }
- }
- }
-}
diff --git a/Jenkinsfile_demo b/Jenkinsfile_demo
deleted file mode 100644
index 3db03236..00000000
--- a/Jenkinsfile_demo
+++ /dev/null
@@ -1,96 +0,0 @@
-pipeline{
- agent any
- environment{
- VERSION = "${env.BUILD_ID}"
- }
- stages{
- stage("sonar qube analysis"){
- agent{
- docker {
- image 'openjdk:11'
- }
- }
- steps{
- script{
- withSonarQubeEnv(credentialsId: 'sonar-token') {
- sh '''
- chmod +x gradlew
- ./gradlew sonarqube
- '''
- }
-
- timeout(5) {
- def qg = waitForQualityGate()
- if (qg.status != 'OK') {
- error "Pipeline aborted due to quality gate failure: ${qg.status}"
- }
- }
- }
- }
- }
-
- stage("building docker image and pushing it to nexus"){
- steps{
- script{
-
- withCredentials([string(credentialsId: 'nexus_pass', variable: 'docker_pass')]) {
- sh '''
-
- docker build -t 35.188.44.251:8083/springapp:${VERSION} .
- docker login -u admin -p $docker_pass 35.188.44.251:8083
- docker push 35.188.44.251:8083/springapp:${VERSION}
- docker rmi 35.188.44.251:8083/springapp:${VERSION}
- docker image prune -f
- '''
- }
- }
- }
- }
-
-
- stage('manual approval'){
- steps{
- script{
- timeout(10) {
- mail bcc: '', body: "
Project: ${env.JOB_NAME}
Build Number: ${env.BUILD_NUMBER}
Go to build url and approve the deployment request
URL de build: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: '', mimeType: 'text/html', replyTo: '', subject: "${currentBuild.result} CI: Project name -> ${env.JOB_NAME}", to: "issamraz1993@gmail.com";
- input(id: "Deploy Gate", message: "Deploy ${params.project_name}?", ok: 'Deploy')
- }
- }
- }
- }
-
-
-
- stage('Deploying application on k8s cluster') {
- steps {
- script{
- withCredentials([kubeconfigFile(credentialsId: 'kubernetes-config', variable: 'KUBECONFIG')]) {
- dir('kubernetes/') {
-
- sh 'helm upgrade --install --set image.repository="35.188.44.251:8083/springapp" --set image.tag="${VERSION}" myjavaapp myapp/ '
- }
- }
- }
- }
- }
-
-
- stage('verifying app deployment'){
- steps{
- script{
- withCredentials([kubeconfigFile(credentialsId: 'kubernetes-config', variable: 'KUBECONFIG')]) {
- sh '''
-
- chmod +x healthcheck.sh
- ./healthcheck.sh
- '''
-
- }
- }
- }
- }
-
-
- }
-
-}
diff --git a/kube.yaml b/kube.yaml
deleted file mode 100644
index d0058111..00000000
--- a/kube.yaml
+++ /dev/null
@@ -1,81 +0,0 @@
----
-apiVersion: v1
-kind: Service
-metadata:
- name: myapp
- labels:
- helm.sh/chart: myapp-0.2.0
- app.kubernetes.io/name: myapp
- app.kubernetes.io/instance: myapp
- app.kubernetes.io/version: "1.16.0"
- app.kubernetes.io/managed-by: Helm
-spec:
- type: NodePort
- ports:
- - port: 8080
- targetPort: http
- protocol: TCP
- name: http
- selector:
- app.kubernetes.io/name: myapp
- app.kubernetes.io/instance: myapp
----
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: myapp
- labels:
- helm.sh/chart: myapp-0.2.0
- app.kubernetes.io/name: myapp
- app.kubernetes.io/instance: myapp
- app.kubernetes.io/version: "1.16.0"
- app.kubernetes.io/managed-by: Helm
-spec:
- replicas: 2
- selector:
- matchLabels:
- app.kubernetes.io/name: myapp
- app.kubernetes.io/instance: myapp
- template:
- metadata:
- labels:
- app.kubernetes.io/name: myapp
- app.kubernetes.io/instance: myapp
- spec:
- imagePullSecrets:
- - name: registry-secret
- containers:
- - name: myapp
- image: imagename
- command: ["/bin/sh"]
- args: ["-c","sh /usr/local/tomcat/bin/startup.sh;while true; do echo hello; sleep 10;done"]
- imagePullPolicy: IfNotPresent
- ports:
- - name: http
- containerPort: 8080
- protocol: TCP
- livenessProbe:
- httpGet:
- path: /
- port: http
- initialDelaySeconds: 60
- periodSeconds: 5
- successThreshold: 1
- failureThreshold: 3
- timeoutSeconds: 10
- readinessProbe:
- httpGet:
- path: /
- port: http
- initialDelaySeconds: 60
- periodSeconds: 5
- successThreshold: 1
- failureThreshold: 3
- timeoutSeconds: 10
- resources:
- requests:
- memory: 0.25Gi
- cpu: 0.5
- limits:
- memory: 0.25Gi
- cpu: 0.5