cmg-ws2024525-demo/cloudbuild.yaml

28 lines
764 B
YAML
Raw Permalink Normal View History

2024-11-22 17:47:21 +01:00
steps:
# Step 1: Clone the repo and identify changed directories
- name: "gcr.io/cloud-builders/git"
entrypoint: "bash"
args:
- "-c"
- |
echo "Identifying changed directories..."
CHANGED_DIRS=$(./changed-directories.sh)
echo "Changed services: $CHANGED_DIRS"
# Step 2: Build, Test, and Containerize for each changed directory
- name: "gcr.io/cloud-builders/docker"
entrypoint: "bash"
args:
- "-c"
- |
for dir in $CHANGED_DIRS; do
echo "Processing $dir"
make -C $dir build test containerize
done
# Step 3: Push container images
- name: "gcr.io/cloud-builders/docker"
args: ["push", "gcr.io/$PROJECT_ID/$IMAGE_NAME"]
timeout: "1200s" # 20 minutes