Как можно «передать» данные аутентификации пользователя Jenkins в сценарий, который использует Jenkins API для создания рабочих мест?

У меня есть скрипт, который удаляет и воссоздает задания с помощью скручиваемых HTTP-вызовов, и я хочу избавиться от любого жестко запрограммированного имени пользователя: пароля. Например.curl -X POST $url --user username:password

Соображения:

Jenkins CLI (probably not an option). One should be able to achieve the same with the CLI as with Jenkins API (creating jobs etc) but as far as I understand Jenkins CLI is not a good alternative for me since jobs created with will only appear in Jenkins after restarting or a "Reload Configuration from Disk", and that would cancel any other running jobs.

API token. Can't find out how to get the user token and then pass it as a parameter to the script, but that may be a solution..

Ответы на вопрос(7)

Ваш ответ на вопрос