在生成中将Jenkins参数传递给python脚本

2024-03-29 11:12:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个jenkins作业,带有参数“github_username”,它被传递给一个python脚本,下面是一行。我使用了一个字符串参数,但脚本是针对用户名的每个字母运行的,而不是针对用户名作为单个单词运行的。 有更好的办法吗

users = os.environ.get("github_username")
import os
## Reading all members from file 
## with open('users.txt') as file:
##    users = file.read().splitlines()
## users = os.environ.get('github_username')

users = os.environ['github_username']

enter image description here


Tags: 字符串github脚本参数getos作业字母