Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #367 from hakman/cloudbuild_gsutil
Browse files Browse the repository at this point in the history
Add gsutil when using Cloud Build
  • Loading branch information
k8s-ci-robot authored Feb 6, 2023
2 parents e674167 + 812ef83 commit 97d3457
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dev/staging/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ options:

steps:
- name: golang:1.19
waitFor: ['-']
env:
- PULL_BASE_REF=$_PULL_BASE_REF
- VERSION=$_GIT_TAG
- DOCKER_REGISTRY=$_DOCKER_REGISTRY
- DOCKER_IMAGE_PREFIX=$_DOCKER_IMAGE_PREFIX
- ARTIFACT_LOCATION=$_ARTIFACT_LOCATION
entrypoint: dev/staging/push-etcdadm.sh
- name: golang:1.19
- name: gcr.io/google.com/cloudsdktool/google-cloud-cli:slim
waitFor: ['-']
env:
- PULL_BASE_REF=$_PULL_BASE_REF
# We don't pass version; we want to use our own version tagging from git
Expand Down
18 changes: 17 additions & 1 deletion dev/staging/push-etcdadm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ if [[ "${ARTIFACT_LOCATION}" != */ ]]; then
ARTIFACT_LOCATION="${ARTIFACT_LOCATION}/"
fi

# Build and upload etcdadm binary
# Build etcdadm binary
make etcdadm

# Upload etcdadm binary
DOWNLOAD_URL="https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz"
echo "Downloading google-cloud-sdk.tar.gz from $DOWNLOAD_URL"
curl -L -o "/tmp/google-cloud-sdk.tar.gz" "${DOWNLOAD_URL}"
tar xzf /tmp/google-cloud-sdk.tar.gz -C /
rm /tmp/google-cloud-sdk.tar.gz
/google-cloud-sdk/install.sh \
--bash-completion=false \
--usage-reporting=false \
--quiet
ln -s /google-cloud-sdk/bin/gcloud /usr/local/bin/gcloud
ln -s /google-cloud-sdk/bin/gsutil /usr/local/bin/gsutil
gcloud info
gcloud config list
gcloud auth list
gsutil -h "Cache-Control:private, max-age=0, no-transform" -m cp -n etcdadm ${ARTIFACT_LOCATION}${VERSION}/etcdadm

0 comments on commit 97d3457

Please sign in to comment.