Не удается получить поле описания задания или параметра Jenkins

Для сервера флагов python вы можете использовать плагин flask-cors для разрешения запросов на междоменные запросы.

См. https://flask-cors.readthedocs.io/en/latest/

0
задан koxta 20 March 2019 в 14:29
поделиться

1 ответ

Это будет совет / обходной путь

https://<<yourjenkinsdomain>>/job/<<yourjobname>>/configure (will open the configuration of your job)

Однако

https://<<yourjenkinsdomain>>/job/<<yourjobname>>/config.xml (will give the job configuration in an xml format)

Вы можете скачать этот xml через curl во время выполнения или с помощью jenkins cli и использовать grep с опцией -B найти описание по значению.

Учитывая, что вы скопировали с именем "config.xml"

cat config.xml | grep -B 1 "description"

Дадим вам описание и имя параметра сборки

 Grep command 
 -B NUM, --before-context=NUM
          Print  NUM  lines  of  leading  context  before  matching lines.
          Places  a  line  containing  a  group  separator  (--)   between
          contiguous  groups  of  matches.  With the -o or --only-matching
          option, this has no effect and a warning is given.

Пример вывода:

cat config.xml | grep -B 1 "description"

<actions/>
<description>Job description : Automation </description>
--
<name>branch</name>
<description>mandatory parameter , used for automation</description>

-

Альтернатива:

jenkins cli имеет опцию для установки значения

set-build-description   Sets the description of a build.
set-build-parameter Update/set the build parameter of the current build in progress. [deprecated]

, вы можете написать небольшой скрипт и получить значения в переменные и использовать их

0
ответ дан prudviraj 20 March 2019 в 14:29
поделиться
Другие вопросы по тегам:

Похожие вопросы: