| commit | efefb70d881d20d368ed4cc8d366b45fc9e31bc4 | [log] [tgz] |
|---|---|---|
| author | chyijia <chyijia@google.com> | Tue Aug 06 04:02:57 2024 +0000 |
| committer | chyijia <chyijia@google.com> | Mon Aug 19 08:49:49 2024 +0000 |
| tree | 649306f3ccf8d49bad9eb5b396aae7ffc87be5cb | |
| parent | 57258e2bfaf4800ff23aecca709b320f7a673453 [diff] |
Add user project overrides feature.
Allow users to override the project id being used to
access the fetch APIs.
Bug: 121042212
Test: fetch_artifact -artifact=<artifact_name> -branch=<branch> \
-target=<target> -client_id=<client_id> -secret=<secret>
-project_id=<project_id>
Test: fetch_artifact -artifact=<artifact_name> -build_id=<build_id>\
-target=<target> -client_id=<client_id> -secret=<secret>
-project_id=<project_id>
Test: fetch_artifact -artifact=<artifact_name> -build_id=<build_id>\
-target=<target> -client_id=<client_id> -secret=<secret>
Change-Id: I2ef97f5fa0d2cbb8831a337ebd20edd05e254270
Fetch artifact is a tool for downloading artifacts from Android's continuous integration service.
target: Required - The target you would like to download the artifact from.artifact: Required - The artifact to download.build_id or branch, but not bothbuild_id is provided, the script would download the artifact from that build_id.branch is provided, the script would download the artifact from the last known good build of that branch.output: Optional - If you would like the contents of the file to be written to a specific file.client_id: Optional - If authorization is required to download the artifact, please set this parameter as your OAuth2.0 Client ID.secret: Optional - If authorization is required to download the artifact, please set this parameter as your OAuth2.0 Client secret.port: Optional - If you would like to specify the OAuth callback port to listen on. Default: 10502project_id: Optional - The project id being used to access the fetch APIs.-: Optional - If you would like the contents of the file to be written to stdout (must be the last arg)fetch_artifact -target=aosp_arm64-userdebug -build_id=7000390 -artifact=COPIED
fetch_artifact -target=aosp_arm64-userdebug -build_id=7000390 -artifact=COPIED -
fetch_artifact -target=aosp_arm64-trunk_staging-userdebug -branch=aosp-main -artifact=COPIED
In this case, you might need to create an OAuth 2.0 Client ID for a web application and set the redirect URI to http://localhost:<port>(default port: 10502).
fetch_artifact -target=<restricted_target> -build_id=<id> -artifact=COPIED -client_id=<OAuth_client_id> -secret=<OAuth_client_secret>
If you are accessing the fetch APIs from a different project than your OAuth client, you will need to specify the -project_id flag:
fetch_artifact -target=<restricted_target> -build_id=<id> -artifact=COPIED -client_id=<OAuth_client_id> -secret=<OAuth_client_secret> -project_id=<project_id>
OUT_DIR=out ./build