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] Lesson 1: Hello World – Pipeline Script & Agent

Posted on October 28, 2021October 29, 2021 By nim No Comments on [Jenkins] Lesson 1: Hello World – Pipeline Script & Agent

Contents

  • 1) first prepare
  • 2) Hello world – Pipeline script
  • 3) Hello world – Pipeline Agent
    • 3.1) agent = none
    • 3.2 agent = slave label
    • 3.3 Custom workspace

1) first prepare

Đầu tiên bạn cần cài con Jenkins và bạn cho nó 1 nhiệm vụ làm master.

[Kaniko/Jenkins] Install Jenkins through helm and build/deploy app in K8s by Kaniko

tiếp đến cài 1 con jenkins và kết nối nó vào master

[Jenkins] Hướng dẫn kết nối kết nối Jenkins master và Agent

2) Hello world – Pipeline script

pipeline{
	agent any
	stages{
		stage("Build"){
			steps{
				echo "Hello world"
			}
		}
	}
}
Các show log
Còn cách khác show log của jenkins

3) Hello world – Pipeline Agent

3.1) agent = none

thì sẽ ntn

3.2 agent = slave label

Kiểm tra label của jenkins slave
Đặt label trên vào script
pipeline{
	agent{
	    label "k8s-permanent"
	}
	stages{
		stage("Build"){
			steps{
				echo "Hello world"
			}
		}
	}
}

3.3 Custom workspace

pipeline{
    agent{
        node{
            label "k8s-permanent"
	        customWorkspace "/home/nimtechnology"
        }
	}
	stages{
		stage("Build"){
			steps{
				echo "Hello world"
			}
		}
	}
}

Sem log nào

Jenkins

Post navigation

Previous Post: [Prometheus] TIP – Custom Prometheus
Next Post: [Jenkins] Lesson 2: Using simple Groovy into Pipeline Script

More Related Articles

[Jenkins – Gitlab] Cấu hình Gitlab Group trên Jenkins và auto thêm webhook Jenkins trên Gitlab CI/CD
[Jenkins] Lesson 2: Using simple Groovy into Pipeline Script Jenkins
[Jenkins] Lesson 10: disable Concurrent Builds in Jenkins Pipeline Jenkins
[Jenkins] Scripted Pipeline lesson 4: Stage _ When Jenkins
[Kaniko/Jenkins] Install Jenkins through helm and build/deploy app in K8s by Kaniko CI/CD
[jenkins] Scripted Pipeline lesson 3: Stage _ Options 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.