cos_kernel_devenv: Migrate from gsutil to gcloud storage BUG=None TEST=presubmit RELEASE_NOTE=None Change-Id: I869826a0f4638d9b7021002cb26c2327cdfa3918 Reviewed-on: https://cos-review.googlesource.com/c/cos/tools/+/159424 Reviewed-by: Vaibhav Rustagi <vaibhavrustagi@google.com> Cloud-Build: 228075978874@cloudbuild.gserviceaccount.com <228075978874@cloudbuild.gserviceaccount.com> Build-Queue: Vaibhav Rustagi <vaibhavrustagi@google.com> Reviewed-by: Chenglong Tang <chenglongtang@google.com> Tested-by: Vaibhav Rustagi <vaibhavrustagi@google.com>
diff --git a/src/cmd/cos_kernel_devenv/devenv.sh b/src/cmd/cos_kernel_devenv/devenv.sh index 7223676..349ebcb 100755 --- a/src/cmd/cos_kernel_devenv/devenv.sh +++ b/src/cmd/cos_kernel_devenv/devenv.sh
@@ -128,7 +128,7 @@ info "Downloading from Google Storage: ${url}" info "Local download location: ${output}" local attempts=0 - until gsutil -q cp "${url}" "${output}"; do + until gcloud storage -q cp "${url}" "${output}"; do attempts=$(( attempts + 1)) if (( "${attempts}" >= "${RETRY_COUNT}" )); then error "Could not download from ${url}" @@ -265,11 +265,11 @@ local -r tc_path="$(cat ${BUILD_DIR}/${TOOLCHAIN_URL_FILENAME})" local tc_download_url="${COS_TC_DOWNLOAD_GCS}${tc_path}" - if ! gsutil -q stat "${tc_download_url}"; then + if ! gcloud storage -q ls "${tc_download_url}"; then tc_download_url="${CROS_TC_DOWNLOAD_GCS}${tc_path}" fi - if ! gsutil -q stat "${tc_download_url}"; then + if ! gcloud storage -q ls "${tc_download_url}"; then error "Toolchain path '${tc_path}' does not exist in either COS or CrOS GCS buckets" return ${RETCODE_ERROR} fi @@ -598,7 +598,7 @@ BRANCH="${BUILD_ID}" echo "** Obtaining the latest build # for branch ${BRANCH}..." readonly latest="${COS_CI_DOWNLOAD_GCS}/${BOARD}-release/LATEST-${BUILD_ID}" - BUILD_ID=$(gsutil -q cat "${latest}" || true) + BUILD_ID=$(gcloud storage -q cat "${latest}" || true) if [[ -n "$BUILD_ID" ]]; then echo "** Latest build for branch ${BRANCH} is ${BUILD_ID}" else