1) Introduction
Alo! Scripted Pipeline khác j với với Jenkins Pipeline?
Thằng nào ngon hơn?
Mấy cái câu này bạn cứ dò google trên đó họ phân tích nhiều lắm rồi. Và để tạo ra sự khác biệt mình ko giải thích mà đi vào bài luôn.
Mình nghĩ sau khi các đọc nát google thì hay sài Scripted Pipeline. Tại sao ư.????
Bạn dò google nhé. Vào bài thôi!!!!
1.1) simple Scripted Pipeline
Bạn sẽ tạo 1 Job
node{
echo "this is scripted pipeline"
}
Anh em sẽ thấy điều khác biệt đâu tiên nó bắt đầu bằng chữ node
Ấn save và run build thôi
1.2) Stage in scripted pipeline
node{
stage('build'){
echo "this is scripted pipeline"
}
}
1.3) Run many agent nodes in a scripted pipeline.
node{
stage('build'){
node('docker-maven'){
echo "this is scripted pipeline"
}
}
}
Khi mà để node
và chả có j hết thì nó sẽ run trên any agent
nếu bạn muốn chỉ định rõ ràng thì node('docker-maven'){}
Và bạn thấy khi run trên agent nào thì nó sử workspace của agent đó
1.4) Run many stages in a scripted pipeline.
node{
stage('build'){
node('docker-maven'){
echo "building"
}
}
stage('deploy'){
node('docker-maven'){
echo "deploying"
}
}
}