JENKINS PIPELINE FROM SCRATCH | Declerative | Checkout and Build | REAL-TIME
Описание
Hi friends, in this video I have shown jenkins declerative pipeline and scripted pipeline from the scratch.This video is for education purpose only.
pipelines
====================
scripted pipeline syntax
---------------------------------------
node {
stage('build') {
}
stage('test') {
}
stage('deploy') {
}
}
declerative pipeline syntax:- in Jenkinsfile
====================================
pipeline {
agent {label 'label11'}
stages {
stage('build') {
steps {
echo "building----"
}
}
stage('test') {
steps {
echo "testing-----"
}
}
}
}
git checkout pipeline:- in jenkins file
=============================
pipeline {
agent {label 'label11'}
stages {
stage('git-checkout') {
steps {
git 'https://github.com/vijay2181/maven-war-project1.git'
}
}
}
}
build:-
=====================
pipeline {
agent {label 'label11'}
stages {
stage('git-checkout') {
steps {
git 'https://github.com/vijay2181/maven-war-project1.git'
}
}
stage('environment-setting') {
steps {
script {
env.BUILD = "yes" // Setting env variable for Build
}
}
}
stage('Build') {
when {environment name: 'BUILD', value: 'yes'}
steps {
echo "Building artifacts ..."
sh "mvn clean package "
}
}
}
}
Рекомендуемые видео



















