Skip to content

Commit

Permalink
Merge branch 'master' into java-21-runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
jianglai committed Mar 6, 2024
2 parents cfbf9d7 + 7424819 commit 9433293
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 20 deletions.
2 changes: 1 addition & 1 deletion release/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ COPY go.sum ./
COPY go.mod ./
RUN go build -o /deployCloudSchedulerAndQueue

FROM marketplace.gcr.io/google/debian11
FROM marketplace.gcr.io/google/ubuntu2204
ENV DEBIAN_FRONTEND=noninteractive LANG=en_US.UTF-8
# Add script for cloud scheduler and cloud tasks deployment
COPY --from=deployCloudSchedulerAndQueueBuilder /deployCloudSchedulerAndQueue /usr/local/bin/deployCloudSchedulerAndQueue
Expand Down
53 changes: 34 additions & 19 deletions release/builder/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,60 +15,75 @@

set -e
apt-get update -y
apt-get upgrade -y

apt-get install locales -y
locale-gen en_US.UTF-8
apt-get install apt-utils gnupg -y
apt-get upgrade -y
apt-get install apt-utils gnupg curl lsb-release -y

# Set up Google Cloud SDK repo
# Cribbed from https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu
apt-get install apt-transport-https ca-certificates -y
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

# Set up PostgreSQL repo. We need pg_dump v11 (same as current server version).
# This needs to be downloaded from postgresql's own repo, because ubuntu2204
# only provides v14.
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list

apt-get update -y

# Install GPG2 (in case it was not included)
apt-get install gnupg2 -y

# Install Java
apt-get install openjdk-21-jdk-headless -y

# Install Python
apt-get install python3 -y
# As of March 2021 python3 is at v3.6. Get pip then install dataclasses
# (introduced in 3.7) for nom_build
apt-get install python3-pip -y
python3 -m pip install dataclasses
# Install curl.
apt-get install curl -y

# Install Node
apt-get install npm -y
npm cache clean -f
npm install -g n
# Retrying because fails are possible for node.js intallation. See -
# Retrying because fails are possible for node.js intallation. See
# https://github.com/nodejs/build/issues/1993
for i in {1..5}; do n 20.10.0 && break || sleep 15; done
# Install gcloud
# Cribbed from https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu
apt-get install lsb-release -y
export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)"
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" \
| tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
# Install pg_dump v11 (same as current server version). This needs to be
# downloaded from postgresql's own repo, because ubuntu1804 is too old. With a
# newer image 'apt-get install postgresql-client-11' may be sufficient.
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" \
> /etc/apt/sources.list.d/pgdg.list'
apt-get update -y

# Install gp_dump
apt-get install postgresql-client-11 procps -y

# Install gcloud
apt-get install google-cloud-cli -y
apt-get install google-cloud-sdk-app-engine-java -y

# Install git
apt-get install git -y

# Install docker
apt-get install docker.io -y

# Install Chrome
apt-get install wget -y
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt install ./google-chrome-stable_current_amd64.deb -y

# Install libxss1 (needed by Karma)
apt install libxss1

# Use unzip to extract files from jars.
apt-get install zip -y

# Get netstat, used for checking Cloud SQL proxy readiness.
apt-get install net-tools

# Clean up
apt-get remove apt-utils locales -y
apt-get autoclean -y
apt-get autoremove -y
Expand Down

0 comments on commit 9433293

Please sign in to comment.