File tree Expand file tree Collapse file tree
containers/python-bootstrap-container Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 "repo" : " googleapis/google-cloud-python" ,
1212 "distribution_name" : " apiPackage" ,
1313 "api_id" : " apiName.googleapis.com" ,
14- "default_version" : " " ,
14+ "default_version" : " apiVersion " ,
1515 "codeowner_team" : " " ,
1616 "api_shortname" : " apiName"
1717}
Original file line number Diff line number Diff line change @@ -29,9 +29,15 @@ PATH_TO_CONTAINER_VARS="$WORKSPACE_DIR/interContainerVars.json"
2929
3030cd " $WORKSPACE_DIR /$MONO_REPO_NAME /containers/python-bootstrap-container"
3131
32+ # API_ID has the form google.cloud.*.vX or `google.*.*.vX`
33+ # Get the version of the API (the value after the last `.`)
34+ # For example, the `API_VERSION` for `google.cloud.workflows.v1`
35+ # will be `v1`
36+ API_VERSION=" $( echo $API_ID | sed ' s/.*\.//' ) "
37+
3238# API_ID has the form google.cloud.*.vX or `google.*.*.vX`
3339# Replace `.`` with `-` and remove the trailing version
34- # For example, the `FOLDER_NAME`` for `google.cloud.workflows.v1`
40+ # For example, the `FOLDER_NAME` for `google.cloud.workflows.v1`
3541# should be `google-cloud-workflows`
3642FOLDER_NAME=" $( echo $API_ID | sed -E ' s/\./-/g' | sed ' s/-[^-]*$//' ) "
3743
@@ -81,6 +87,8 @@ DOCS_ROOT_URL=$(jq --arg API_SHORTNAME "$API_SHORTNAME" -r '.apis | to_entries[]
8187# Update apiProductDocumentation in .repo-metadata.json
8288sed -i -e " s|apiProductDocumentation|$DOCS_ROOT_URL |" " ${WORKSPACE_DIR} /${MONO_REPO_NAME} /packages/${FOLDER_NAME} /.repo-metadata.json"
8389
84- # Update distribution_name in .repo-metadata.json
90+ # Update apiPackage in .repo-metadata.json
8591sed -i -e " s|apiPackage|$FOLDER_NAME |" " ${WORKSPACE_DIR} /${MONO_REPO_NAME} /packages/${FOLDER_NAME} /.repo-metadata.json"
8692
93+ # Update apiVersion in .repo-metadata.json
94+ sed -i -e " s|apiVersion|$API_VERSION |" " ${WORKSPACE_DIR} /${MONO_REPO_NAME} /packages/${FOLDER_NAME} /.repo-metadata.json"
You can’t perform that action at this time.
0 commit comments