Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Add Google Cloud SDK #36

Merged
merged 11 commits into from
Nov 22, 2016
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ RUN mvn --version
RUN gem install fastlane --no-document
RUN fastlane --version

# ------------------------------------------------------
# --- Install Google Cloud SDK
# --- https://github.com/GoogleCloudPlatform/cloud-sdk-docker/blob/master/Dockerfile
# --- https://firebase.google.com/docs/test-lab/command-line
# --- https://cloud.google.com/sdk/downloads?hl=sr#linux

ENV CLOUD_SDK_REPO="cloud-sdk-xenial"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" would be better, without that we'll have to update this variable from xenial when we update the base Ubuntu version

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back ticks should work, we use it here for example: https://github.com/bitrise-docker/bitrise-base/blob/master/Dockerfile#L95

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


RUN echo "deb https://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, as $CLOUD_SDK_REPO is not used anywhere else, we could remove the ENV line and instead include

cloud-sdk-`lsb_release -c -s`

here directly, like:

RUN echo "deb https://packages.cloud.google.com/apt cloud-sdk-`lsb_release -c -s` main"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, I will make this update.

&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - \
&& sudo apt-get update -qq \
&& sudo apt-get install -y -qq google-cloud-sdk

RUN /usr/bin/gcloud config set --installation component_manager/disable_update_check true
RUN sed -i -- 's/\"disable_updater\": false/\"disable_updater\": true/g' /usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/config.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this required even if you run gcloud config set --installation component_manager/disable_update_check true ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't gcloud config set --installation component_manager/disable_update_check true enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, see the upstream comment:

# Disable updater completely.
# Running `gcloud components update` doesn't really do anything in a union FS.
# Changes are lost on a subsequent run.
RUN sed -i -- 's/\"disable_updater\": false/\"disable_updater\": true/g' /google-cloud-sdk/lib/googlecloudsdk/core/config.json

I also manually confirmed that gcloud config set never updates the config.json file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thank you!


# ------------------------------------------------------
# --- Cleanup and rev num

Expand Down
1 change: 1 addition & 0 deletions system_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ver_line="$(gradle --version | grep 'Gradle ')" ; echo "* Gradle: $ver_line"
ver_line="$(mvn --version | grep 'Apache Maven')" ; echo "* Maven: $ver_line"
ver_line="$(fastlane --version | grep 'fastlane ')" ; echo "* Fastlane: $ver_line"
ver_line="$( javac -version 2>&1 )" ; echo "* Java: $ver_line"
ver_line="$( gcloud version )" ; echo "* gcloud: $ver_line"

echo "========================================"
echo
Expand Down