mirror of https://github.com/mongodb/mongo
SERVER-113676 Update profiling data script to use environment variable (#43783)
GitOrigin-RevId: ce80b48f068e5388bf38591bbad2bf3c55b590ac
This commit is contained in:
parent
5415c44156
commit
2e740e56a7
|
|
@ -190,8 +190,22 @@ if __name__ == "__main__":
|
||||||
parser.add_argument("gcc_pgo_url", help="URL that gcc pgo data was uploaded to.")
|
parser.add_argument("gcc_pgo_url", help="URL that gcc pgo data was uploaded to.")
|
||||||
parser.add_argument("target_branch", help="The branch you want to create a PR into.")
|
parser.add_argument("target_branch", help="The branch you want to create a PR into.")
|
||||||
parser.add_argument("new_branch", help="The new branch to create a PR from.")
|
parser.add_argument("new_branch", help="The new branch to create a PR from.")
|
||||||
parser.add_argument("app_id", help="App ID used for authentication.")
|
parser.add_argument(
|
||||||
parser.add_argument("private_key", help="Key to use for authentication.")
|
"--app_id", help="App ID used for authentication.", default=os.getenv("MONGO_PR_BOT_APP_ID")
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--private_key",
|
||||||
|
help="Key to use for authentication.",
|
||||||
|
default=os.getenv("MONGO_PR_BOT_PRIVATE_KEY"),
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
repo = get_mongo_repository(args.app_id, args.private_key)
|
if not args.app_id or not args.private_key:
|
||||||
|
parser.error(
|
||||||
|
"Must define --app-id or env MONGO_PR_BOT_APP_ID and --private-key or env MONGO_PR_BOT_PRIVATE_KEY."
|
||||||
|
)
|
||||||
|
# Replace spaces with newline, if applicable
|
||||||
|
private_key = (
|
||||||
|
args.private_key[:31] + args.private_key[31:-29].replace(" ", "\n") + args.private_key[-29:]
|
||||||
|
)
|
||||||
|
repo = get_mongo_repository(args.app_id, private_key)
|
||||||
create_profile_data_pr(repo, args, args.target_branch, args.new_branch)
|
create_profile_data_pr(repo, args, args.target_branch, args.new_branch)
|
||||||
|
|
|
||||||
|
|
@ -1302,6 +1302,9 @@ tasks:
|
||||||
- command: subprocess.exec
|
- command: subprocess.exec
|
||||||
params:
|
params:
|
||||||
binary: bash
|
binary: bash
|
||||||
|
include_expansions_in_env:
|
||||||
|
- MONGO_PR_BOT_APP_ID
|
||||||
|
- MONGO_PR_BOT_PRIVATE_KEY
|
||||||
args:
|
args:
|
||||||
- "src/evergreen/run_python_script.sh"
|
- "src/evergreen/run_python_script.sh"
|
||||||
- "buildscripts/profile_data_pr.py"
|
- "buildscripts/profile_data_pr.py"
|
||||||
|
|
@ -1310,8 +1313,6 @@ tasks:
|
||||||
- "https://mdb-build-public.s3.us-east-1.amazonaws.com/profiling_data/pgo/mongod_${revision}_${build_arch}_gcc_lto_pgo_${version}.tgz"
|
- "https://mdb-build-public.s3.us-east-1.amazonaws.com/profiling_data/pgo/mongod_${revision}_${build_arch}_gcc_lto_pgo_${version}.tgz"
|
||||||
- "${branch_name}"
|
- "${branch_name}"
|
||||||
- "SERVER-110427-${revision}"
|
- "SERVER-110427-${revision}"
|
||||||
- "${MONGO_PR_BOT_APP_ID}"
|
|
||||||
- "${MONGO_PR_BOT_PRIVATE_KEY}"
|
|
||||||
- name: publish_crypt_packages
|
- name: publish_crypt_packages
|
||||||
run_on: rhel8.7-small
|
run_on: rhel8.7-small
|
||||||
tags:
|
tags:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue