Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
    • Helm Chart
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log & Monitor
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
  • Toggle search form

[jenkins] Scripted Pipeline lesson 1: Introduction

Posted on November 13, 2021November 13, 2021 By nim No Comments on [jenkins] Scripted Pipeline lesson 1: Introduction

Contents

  • 1) Introduction
    • 1.1) simple Scripted Pipeline
    • 1.2) Stage in scripted pipeline
    • 1.3) Run many agent nodes in a scripted pipeline.
    • 1.4) Run many stages in a scripted pipeline.

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

Log lá của nó đây

1.2) Stage in scripted pipeline

node{
    stage('build'){
       echo "this is scripted pipeline" 
    }
}
Có stage time nhìn chuyên nghiệp hơn.

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" 
        }
    }
}
This image has an empty alt attribute; its file name is image-210.png
Jenkins

Post navigation

Previous Post: [Istio] Workload injected Istio that can’t connect Database(Redis, PostgreSQL) – excludeOutboundPorts or excludeIPRanges
Next Post: [VMware] Comand check health disk ESXi

More Related Articles

[Kaniko/Jenkins] Install Jenkins through helm and build/deploy app in K8s by Kaniko CI/CD
[Jenkins] Lesson 2: Using simple Groovy into Pipeline Script Jenkins
[Jenkins] Share Libraries 5: Custom Steps Jenkins
[Jenkins] Share Libraries 1: Global Function Jenkins
[Jenkins] Hướng dẫn sử dụng Jenkins pipeline to control Jenkins agent in k8s and deploy on k8s CI/CD
[Jenkins] Share Library 2: Import library Jenkins

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [Smartctl] Instruction check the health disk of Raspberry. January 16, 2023
  • [kubectl/Argocd] How to create a kubectl config file for serviceaccount or from the cluster secret of Argocd January 12, 2023
  • [Helm/Github] Create a public Helm chart repository with GitHub Pages January 8, 2023
  • [AWS] How to increase the disk size of a Windows EC2 machine? January 4, 2023
  • [Redis] ElastiCache-Redis Cross-Region Replication|Global DataStore January 3, 2023

Archives

  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • Golang
    • Jquery & JavaScript
    • Laravel
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kubernetes
      • Ingress
    • Longhorn – Storage
    • Vault
    • VictoriaMetrics
  • Log & Monitor
    • ELK
      • Kibana
      • Logstash
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2023 NimTechnology.