Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def checkoutSourceCode() {
}

def pathExistsCloudStorage(filePath) {
def status = sh(returnStatus: true, script: "gsutil stat ${filePath}")
def status = sh(returnStatus: true, script: "gcloud storage objects list --stat ${filePath}")
return status == 0
}

Expand All @@ -839,8 +839,8 @@ def fastStash(name, stashPaths) {
if (!pathExistsCloudStorage(archivePath)) {
echo("Stashing ${stashPaths} to ${archivePath}")
retry(5) {
sh("tar czf - ${stashPaths} | gsutil " +
"-h Content-Type:application/x-gtar cp - ${archivePath}")
sh("tar czf - ${stashPaths} | gcloud storage cp " +
" - ${archivePath} --content-type="application/x-gtar")
sleep(5)
}
}
Expand All @@ -849,7 +849,7 @@ def fastStash(name, stashPaths) {
def fastUnstash(name) {
def archivePath = stashArchivePath(name)
retry(5) {
sh("gsutil cp ${archivePath} - | tar zxf - ")
sh("gcloud storage cp ${archivePath} - | tar zxf - ")
sleep(5)
}
}
Expand Down
11 changes: 5 additions & 6 deletions script/all-utilities
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function retry() {
# Download api Keys from Cloud storage and source the file.
function set_api_keys() {
local api_key_directory="$(mktemp -d)"
$GSUTIL cp gs://esp-testing-secret-files/api_keys \
$GCLOUD storage cp gs://esp-testing-secret-files/api_keys \
"${api_key_directory}/api_keys" \
|| error_exit "Failed to download API key file."

Expand All @@ -159,8 +159,7 @@ function set_api_keys() {
# Download test-client keys from Cloud storage
function get_test_client_key() {
local key_path=$1
[[ -e $key_path ]] || $GSUTIL \
cp gs://esp-testing-secret-files/esp-test-client-b1289e36f3df.json $key_path
[[ -e $key_path ]] || $GCLOUD storage cp gs://esp-testing-secret-files/esp-test-client-b1289e36f3df.json $key_path
echo -n $key_path
return 0
}
Expand Down Expand Up @@ -294,7 +293,7 @@ function activate_service_account() {
;;
esac
echo "Downloading ${project} service account"
retry -n 5 -s 10 gsutil cp \
retry -n 5 -s 10 gcloud storage cp \
"gs://esp-testing-secret-files/${remote_json_name}" "${local_json}" \
|| error_exit "Could not download secret keys for ${project}"
echo "Gcloud auth activate ${project} service account."
Expand All @@ -319,7 +318,7 @@ function update_tool() {

[[ -z "${TOOLS_BUCKET}" ]] && return 1
echo "Uploading ${local_path} to ${remote_path}."
${GSUTIL} cp "${local_path}" "${remote_path}" \
${GCLOUD} storage cp "${local_path}" "${remote_path}" \
|| { echo "Failed to upload ${tool_name} to ${TOOLS_BUCKET}"; return 1; }
return 0
}
Expand All @@ -332,7 +331,7 @@ function get_tool() {

[[ -z "${TOOLS_BUCKET}" ]] && return 1
echo "Downloading ${remote_path} to ${local_path}."
${GSUTIL} cp "${remote_path}" "${local_path}" \
${GCLOUD} storage cp "${remote_path}" "${local_path}" \
|| { echo "Failed to upload ${tool_name} to ${TOOLS_BUCKET}"; return 1; }
return 0
}