Skip to content

Commit

Permalink
use docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed Dec 19, 2024
1 parent dbdfae7 commit abd07eb
Showing 1 changed file with 48 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,34 +63,54 @@ steps:
id: prepare-golden
waitFor: ["-"]

- name: ubuntu:24.04
entrypoint: bash
args:
- "-c"
- |
# Install docker
apt update
apt install -y ca-certificates curl gnupg lsb-release
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt -y install \
docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
docker run \
--rm \
--quiet \
-u "$(id -u):$(id -g)" \
-v "/workspace/google-cloud-java:/workspace" \
-v "/workspace/hermetic_build/library_generation/tests/resources/integration/google-cloud-java:/workspace/config" \
-v "/workspace/googleapis:/workspace/apis" \
"${_TEST_IMAGE}" \
--generation-config-path="/workspace/config/generation_config.yaml" \
--api-definitions-path="/workspace/apis"
#- name: ubuntu:24.04
# entrypoint: bash
# args:
# - "-c"
# - |
# # Install docker
# apt update
# apt install -y ca-certificates curl gnupg lsb-release
# mkdir -p /etc/apt/keyrings
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
# gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# echo \
# "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
# $(lsb_release -cs) stable" | \
# tee /etc/apt/sources.list.d/docker.list > /dev/null
# apt update
# apt -y install \
# docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# docker run \
# --rm \
# --quiet \
# -u "$(id -u):$(id -g)" \
# -v "/workspace/google-cloud-java:/workspace" \
# -v "/workspace/hermetic_build/library_generation/tests/resources/integration/google-cloud-java:/workspace/config" \
# -v "/workspace/googleapis:/workspace/apis" \
# "${_TEST_IMAGE}" \
# --generation-config-path="/workspace/config/generation_config.yaml" \
# --api-definitions-path="/workspace/apis"
# id: generate-libraries
# waitFor: [
# "build-image",
# "download-api-definitions",
# "prepare-golden"
# ]

- name: gcr.io/cloud-builders/docker
args: [
"run",
"--rm",
"-v", "/workspace/google-cloud-java:/workspace",
"-v", "/workspace/hermetic_build/library_generation/tests/resources/integration/google-cloud-java:/workspace/config",
"-v", "/workspace/googleapis:/workspace/apis",
"${_TEST_IMAGE}",
"--generation-config-path=/workspace/config/generation_config.yaml",
"--api-definitions-path=/workspace/apis"
]
env:
- "DOCKER_BUILDKIT=1"
id: generate-libraries
waitFor: [
"build-image",
Expand Down

0 comments on commit abd07eb

Please sign in to comment.