Skip to content

Commit

Permalink
move steps to config
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeWang1127 committed Dec 18, 2024
1 parent e58cf09 commit ce51ccb
Showing 1 changed file with 40 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,51 @@
# limitations under the License.

timeout: 7200s # 2 hours
substitutions:
_TEST_IMAGE: "test-image:latest"
steps:
- name: gcr.io/cloud-builders/docker
args: [
"build",
"-t", "${_TEST_IMAGE}",
"-f", ".cloudbuild/library_generation/library_generation_airlock.Dockerfile",
"."
]
id: build-image
waitFor: ["-"]
env:
- "DOCKER_BUILDKIT=1"
- name: ubuntu:24.04
entrypoint: bash
args:
- "-c"
- |
cd /workspace
git clone https://github.com/googleapis/googleapis
cd googleapis
git switch 113a378d5aad5018876ec0a8cbfd4d6a4f746809
id: download-api-definitions
waitFor: ["-"]
- name: ubuntu:24.04
entrypoint: bash
args:
- "-c"
- |
# Install docker
apt-get update
apt-get 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-get update
apt-get -y install \
docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin \
maven python3.12-venv
# Install python dependencies
python3 -m venv .venv
source .venv/bin/activate
python --version
pip install --upgrade pip
pip install --require-hashes -r hermetic_build/common/requirements.txt
pip install hermetic_build/common
pip install --require-hashes -r hermetic_build/library_generation/requirements.txt
pip install hermetic_build/library_generation
python3 -m unittest hermetic_build/library_generation/tests/integration_tests_cloud_build.py
- "-c"
- |
cd /workspace
git clone https://github.com/googleapis/google-cloud-java
cd google-cloud-java
git switch 113a378d5aad5018876ec0a8cbfd4d6a4f746809
git checkout chore/test-hermetic-build
mkdir ../golden
cd ../golden
cp -r ../google-cloud-java/java-apigee-connect .
cp -r ../google-cloud-java/java-alloydb .
cp -r ../google-cloud-java/java-alloydb-connectors .
cp -r ../google-cloud-java/java-cloudcontrolspartner .
cp -r ../google-cloud-java/gapic-libraries-bom .
cp -r ../google-cloud-java/pom.xml .
id: prepare-golden
waitFor: ["-"]
id: integration-test

options:
logging: CLOUD_LOGGING_ONLY

0 comments on commit ce51ccb

Please sign in to comment.