From 2074f46fbeeacc3aa9f58638ed1625a56bd0603a Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Tue, 9 Apr 2024 15:42:30 -0700 Subject: [PATCH] jenkins: use token for pushing to openpilot-releases (#32146) use token Co-authored-by: tester old-commit-hash: 91713bed2627bef431af0fbcca485e054112d875 --- Jenkinsfile | 3 +++ release/upload_casync_release.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c01a702fff..45a18879f5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,6 +26,7 @@ export SOURCE_DIR=${env.SOURCE_DIR} export GIT_BRANCH=${env.GIT_BRANCH} export GIT_COMMIT=${env.GIT_COMMIT} export AZURE_TOKEN='${env.AZURE_TOKEN}' +export AZURE_TOKEN_OPENPILOT_RELEASES='${env.AZURE_TOKEN_OPENPILOT_RELEASES}' export MAPBOX_TOKEN='${env.MAPBOX_TOKEN}' # only use 1 thread for tici tests since most require HIL export PYTEST_ADDOPTS="-n 0" @@ -134,9 +135,11 @@ def pcStage(String stageName, Closure body) { def setupCredentials() { withCredentials([ string(credentialsId: 'azure_token', variable: 'AZURE_TOKEN'), + string(credentialsId: 'azure_token_openpilot_releases', variable: 'AZURE_TOKEN_OPENPILOT_RELEASES'), string(credentialsId: 'mapbox_token', variable: 'MAPBOX_TOKEN') ]) { env.AZURE_TOKEN = "${AZURE_TOKEN}" + env.AZURE_TOKEN_OPENPILOT_RELEASES = "${AZURE_TOKEN_OPENPILOT_RELEASES}" env.MAPBOX_TOKEN = "${MAPBOX_TOKEN}" } } diff --git a/release/upload_casync_release.py b/release/upload_casync_release.py index 0119ebfa0e..4261e298a8 100755 --- a/release/upload_casync_release.py +++ b/release/upload_casync_release.py @@ -7,7 +7,8 @@ from openpilot.tools.lib.azure_container import AzureContainer if __name__ == "__main__": - del os.environ["AZURE_TOKEN"] # regerenate token for this bucket + if "AZURE_TOKEN_OPENPILOT_RELEASES" in os.environ: + os.environ["AZURE_TOKEN"] = os.environ["AZURE_TOKEN_OPENPILOT_RELEASES"] OPENPILOT_RELEASES_CONTAINER = AzureContainer("commadist", "openpilot-releases")