DevOps Tutorial 12 : CICD Java Maven project using Jenkins Code as Pipeline

preview_player
Показать описание
Hello Friends ,

Welcome to DevOps tutorial .

In this lecture we will learn CICD Java Maven project using Jenkins Code as Pipeline.

Below is the script for Jenkins Pipeline

pipeline {

agent any

stages{

stage('clean the code ')
{
steps{
sh 'mvn clean'
}
}

stage('unit testing')
{
steps{
sh 'mvn test'
}
}
stage('deploy to tomcat')
{
steps{
sh 'mvn package'
sshagent(['tomcat']) { . // get this from pipeline script using sshAgent plugins
sh """
scp -o StrictHostKeyChecking=no **/*.war yourserver:/opt/tomcat/apache-tomcat-9.0.33/webapps
"""
}
}
}
}
}

#Jenkins #CodeAsPipeline #DevOps #CICD #Java # JenkinsCodeAsPipeline
#continuousintegration #continuousdeployment #maven #Tomcat9
Рекомендации по теме
Комментарии
Автор

Hi Abhishek, thanks for this amazing video how can I enable the pipeline syntax in Jenkins ! kindly suggest in new jenkins its not visible

antaraatma
join shbcf.ru