cmg-ws2024525-demo/cloudbuild.yaml

28 lines
764 B
YAML

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