diff --git a/README.md b/README.md index d8e61d3..209d7dd 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ # mindcircuit13 - SAMPLE APP + +Installed tomcat, jenkins, Git in a single container and serving an application diff --git a/Service.yaml b/Service.yaml new file mode 100644 index 0000000..65c09cb --- /dev/null +++ b/Service.yaml @@ -0,0 +1,18 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: fb-svc + labels: + app: facebook + +spec: + type: LoadBalancer + ports: + - port: 80 + targetPort: 8080 + protocol: TCP + + selector: + app: facebook + diff --git a/deploymentac_1.yaml b/deploymentac_1.yaml new file mode 100644 index 0000000..774ba57 --- /dev/null +++ b/deploymentac_1.yaml @@ -0,0 +1,26 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fbdeploy + labels: + app: facebook + env: sbox +spec: + selector: + matchLabels: + app: facebook + replicas: 3 + template: + metadata: + name: fbpod + labels: + app: facebook + env: sbox + version: AC_V1 + spec: + containers: + - name: fbcont + image: devopshubg333/batch14:mcappimag + ports: + - containerPort: 8080 diff --git a/deploymentfiles/deployment.yml b/deploymentfiles/deployment.yml new file mode 100644 index 0000000..e9eb307 --- /dev/null +++ b/deploymentfiles/deployment.yml @@ -0,0 +1,24 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: fbdeploy + labels: + app: facebook +spec: + selector: + matchLabels: + app: facebook + replicas: 2 + template: + metadata: + name: fbpod + labels: + app: facebook + spec: + containers: + - name: fbcont + image: kadarlasanthosh/santhosh_repo:19 + ports: + - containerPort: 8080 + diff --git a/deploymentfiles/service.yml b/deploymentfiles/service.yml new file mode 100644 index 0000000..4ac35e5 --- /dev/null +++ b/deploymentfiles/service.yml @@ -0,0 +1,17 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: fb-svc + labels: + app: facebook + +spec: + type: LoadBalancer + ports: + - port: 80 + targetPort: 8080 + protocol: TCP + + selector: + app: facebook diff --git a/jenkinsfile b/jenkinsfile index 53a295f..9e71023 100644 --- a/jenkinsfile +++ b/jenkinsfile @@ -1,28 +1,35 @@ pipeline { agent any + tools { + maven 'maven_3.9.9' + } + stages { - stage('GIT CLONE SCM') { + stage('CLONE SCM') { steps { - echo "CLONING code from Github repo" - git branch: 'main', url: 'https://github.com/devopstraininghub/mindcircuit14.git' + echo 'Cloning code from Github' + git branch: 'main', url: 'https://github.com/Kadarlasanthosh/mindcircuit14.git' } } - stage('BUILD ') { + stage('BUILD ARTIFACT') { steps { - echo "Building code " + echo 'Building project with Maven' + sh 'mvn clean install' } } - - stage('TOMCAT DEPLOY') { + + stage('DEPLOY to TOMCAT') { steps { - echo "Deploying war file to tomcat" - deploy adapters: [tomcat9(credentialsId: 'tomcat', path: '', url: 'http://ec2-54-173-89-134.compute-1.amazonaws.com:8091/')], contextPath: 'facebook', war: '**/*.war' + echo 'Deploy artifacts to TOMCAT web server' + deploy adapters: [tomcat9(credentialsId: 'tomcat', path: '', url: 'http://54.227.47.119:8091/')], contextPath: 'mcfbapp', war: '**/*.war' + } - } + } } + } diff --git a/pom.xml b/pom.xml index 851009a..94808cc 100644 --- a/pom.xml +++ b/pom.xml @@ -40,4 +40,3 @@ - diff --git a/results.json b/results.json new file mode 100644 index 0000000..e69de29 diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index e10d9f7..3894b3e 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -1,32 +1,7 @@ - - -