#Task_6 Devops JENKINS AND GROOVY

  1. Create container image that’s has Jenkins installed using dockerfile Or You can use the Jenkins Server on RHEL 8/7
    2. When we launch this image, it should automatically starts Jenkins service in the container.
    3. Create a job chain of job1, job2, job3 and job4 using build pipeline plugin in Jenkins
    4. Job2 ( Seed Job ) : Pull the Github repo automatically when some developers push repo to Github.
    5. Further on jobs should be pipeline using written code using Groovy language by the developer
    6. Job1 :
    1. By looking at the code or program file, Jenkins should automatically start the respective language interpreter installed image container to deploy code on top of Kubernetes ( eg. If code is of PHP, then Jenkins should start the container that has PHP already installed )
    2. Expose your pod so that testing team could perform the testing on the pod
    3. Make the data to remain persistent using PVC ( If server collects some data like logs, other user information )
    7. Job3 : Test your app if it is working or not.
    8. Job4 : if app is not working , then send email to developer with error messages and redeploy the application after code is being edited by the developer
apiVersion: v1
kind: Service
metadata:
name: web-service
labels:
app: httpd
spec:
ports:
- nodePort: 9091
port: 80
targetPort: 80
selector:
app: httpd
tier: web
type: NodePort
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: volumeclaim
lables:
app: httpd
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: httpd
labels:
app: httpd
spec:
selector:
matchLables:
app: httpd
tier: web
strategy:
type: Recreate
template:
metadata:
labels:
app: httpd
tier: web
spec:
containers:
- image: rish27/httpd:v1
name: httpd
ports:
- containerPort: 80
name: httpd
volumeMounts:
- name: ps
mountPath: /var/www/html
volumes:
- name: ps
persistenVolumeClaim:
claimName: volumeclaim
def gitUrl = 'git://github.com/test/test'

job('test-job') {
scm {
git(gitUrl)
}
triggers {
scm('*/15 * * * *')
}
steps {
maven('-e clean test')
}
}

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Teacher to Merchandiser to Developer

Terraform vs shell code

Single Linked List implementation in Scala

How to deploy a built Rails app with SQlite3 to Heroku

A Quick Introduction To Git

How to Monitor Amazon Chime Network Performance

How to Monitor Amazon Chime Network Performance

How to become a lead developer?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jainrishabh

Jainrishabh

More from Medium

Launch a container in containerized docker

Top 13 Vue Devtools for Developers in 2022

File system of linux

Python Automation with Selenium, Openpyxl — Input excel data into web forms automatically