Cov txheej txheem:

Kuv yuav teeb tsa ib puag ncig hloov pauv hauv Jenkins li cas?
Kuv yuav teeb tsa ib puag ncig hloov pauv hauv Jenkins li cas?

Video: Kuv yuav teeb tsa ib puag ncig hloov pauv hauv Jenkins li cas?

Video: Kuv yuav teeb tsa ib puag ncig hloov pauv hauv Jenkins li cas?
Video: Nco Txog Hmoob - Xf. Txawj Pes Vaj & Fishermen's Project (Live Session) [Lyric Video] 2024, Hlis ntuj nqeg
Anonim

Los ntawm Jenkins web interface, mus rau Tswj Jenkins> Tswj Plugins thiab nruab lub plugin

  1. Mus rau koj txoj haujlwm Configure npo.
  2. Nrhiav Ntxiv tsim cov kauj ruam hauv Build section thiab xaiv Txhaj ib puag ncig hloov pauv .
  3. Teeb qhov xav tau ib puag ncig hloov pauv as VARIABLE_NAME=VALUE qauv.

Ib sab ntawm no, kuv yuav ua li cas thiaj tau Jenkins ib puag ncig hloov pauv?

Ib txoj kev yooj yim rau tau tus Jenkins ib puag ncig hloov pauv daim ntawv teev npe los ntawm koj lub zos installation yog los ntxiv env -vars. html rau lub server's URL. Rau ib lub zos hosted Jenkins server, qhov URL yuav yog: env -vars.html.

Qhov thib ob, Kuv yuav teeb tsa ib puag ncig hloov pauv li cas hauv bash? Rau teeb ib ib puag ncig hloov pauv txhua lub sijhawm, siv cov lus txib export hauv. bashrc cov ntaub ntawv (los yog cov ntaub ntawv pib tsim nyog rau koj lub plhaub). Rau teeb ib ib puag ncig hloov pauv los ntawm ib tsab ntawv, siv cov lus txib export hauv tsab ntawv, thiab tom qab ntawd los ntawm tsab ntawv. Yog tias koj ua tiav tsab ntawv nws yuav tsis ua haujlwm.

Qhov thib ob, Jenkins ib puag ncig hloov pauv yog dab tsi?

Jenkins teeb ib puag ncig hloov pauv

Environment Variable Kev piav qhia
Environment Variable Kev piav qhia
BUILD_NUMBER Tus naj npawb tsim tam sim no, xws li "153"
BUILD_ID Tus ID tsim tam sim no, xws li "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss, defunct txij li version 1.597)

Yuav ua li cas koj tshaj tawm qhov sib txawv hauv Jenkins pipeline?

Jenkins Pipeline : Yuav ua li cas Txhais a Hloov pauv – Jenkins Variables . Hloov pauv hauv a Jenkinsfile tuaj yeem yog txhais los ntawm kev siv lub def lo lus tseem ceeb. Xws li sib txawv yuav tsum yog txhais ua ntej lub cov kav dej thaiv pib. Thaum twg sib txawv yog txhais , nws tuaj yeem raug hu los ntawm Jenkins tshaj tawm cov kav dej siv ${} syntax.

Pom zoo: