Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (38 sloc) 1.5 KB
steps:
- name: "gcr.io/cloud-builders/docker"
entrypoint: "bash"
args:
- "-c"
- |
docker pull gcr.io/$PROJECT_ID/sish:$BRANCH_NAME-builder-latest || true
docker pull gcr.io/$PROJECT_ID/sish:master-builder-latest || true
docker build -t gcr.io/$PROJECT_ID/sish:$BRANCH_NAME-builder-$SHORT_SHA \
-t gcr.io/$PROJECT_ID/sish:$BRANCH_NAME-builder-latest \
--cache-from gcr.io/$PROJECT_ID/sish:$BRANCH_NAME-builder-latest \
--cache-from gcr.io/$PROJECT_ID/sish:master-builder-latest \
--target builder .
- name: "gcr.io/$PROJECT_ID/sish:$BRANCH_NAME-builder-$SHORT_SHA"
entrypoint: "sh"
args:
- "-c"
- |
go test ./...
- name: "gcr.io/cloud-builders/docker"
entrypoint: "bash"
args:
- "-c"
- |
docker pull gcr.io/$PROJECT_ID/sish:$BRANCH_NAME-builder-latest || true
docker pull gcr.io/$PROJECT_ID/sish:master-builder-latest || true
docker build -t gcr.io/$PROJECT_ID/sish:$SHORT_SHA \
--cache-from gcr.io/$PROJECT_ID/sish:$BRANCH_NAME-builder-$SHORT_SHA \
--cache-from gcr.io/$PROJECT_ID/sish:master-builder-latest .
if [[ "$BRANCH_NAME" == "master" ]]; then
docker tag gcr.io/$PROJECT_ID/sish:$SHORT_SHA gcr.io/$PROJECT_ID/sish:latest
docker push gcr.io/$PROJECT_ID/sish:latest
else
exit 0
fi
images:
- "gcr.io/$PROJECT_ID/sish:$SHORT_SHA"
- "gcr.io/$PROJECT_ID/sish:$BRANCH_NAME-builder-latest"
You can’t perform that action at this time.