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
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Jquery & JavaScript
    • Git
    • Selenium
  • Log & Monitor
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
  • Toggle search form

[Jenkins/Git] Why do My Jenkins get env.BRANCH_NAME of Git that is Null

Posted on October 24, 2021October 24, 2021 By nim No Comments on [Jenkins/Git] Why do My Jenkins get env.BRANCH_NAME of Git that is Null

Note lại chút, 1 Job trên Jenkins tương tác với gitlab hay github.
Mình cần jenkins có được các thông tin của repo như branch nào, commit nào,…???

Bạn tạo 1 job với type Pipeline

Trong jenkins file, bạn thực hiện echo env.BRANCH_NAME nhưng lại bị rỗng hay null

Lý do: https://stackoverflow.com/questions/43770058/jenkins-pipeline-branch-name-returns-null

Đây là câu trả lời

Vậy thì bạn cần tạo 1 job với type: Multibanch Pipeline thì sẽ lấy được env.BRANCH_NAME

p/s: Mình nhớ là vẫn lấy được branch và commit trên type Pipeline.
Mình sẽ để mình thêm sau nhé

Git, Jenkins

Post navigation

Previous Post: [Jenkins] Install Jenkins StandAlone in Kubernetes
Next Post: [Grafana] Design chart Gause Bar – Grafana with Metrics Sum

More Related Articles

[Jenkins] Scripted Pipeline lesson 4: Stage _ When Jenkins
[Jenkins] Share Libraries 3: Import library class. 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 Libraries 7: Importing Third-Party Libraries Jenkins
[Jenkins – Gitlab] Cấu hình Gitlab Group trên Jenkins và auto thêm webhook Jenkins trên Gitlab CI/CD

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

  • Protected: My Assignment  June 24, 2022
  • [Spinnaker] Spinnaker writes too many logs – Reduce spinnaker log level June 22, 2022
  • [Jenkins] Jobs will be created automatically by Jenkins Job Builder June 20, 2022
  • [Postgresql] Install postgresql client and trying a few command postgresql. June 20, 2022
  • [Mount/Nextcloud] How do you mount a hard disk that was used windows into Linux. June 19, 2022

Archives

  • 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
    • Jenkins
    • Spinnaker
  • Coding
    • Git
    • Golang
    • Jquery & JavaScript
    • Laravel
    • 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 © 2022 NimTechnology.