Merge pull request #1326 from njuettner/image-publishing

Enable image publishing
This commit is contained in:
Kubernetes Prow Robot 2020-01-07 01:40:19 -08:00 committed by GitHub
commit 4c6b7c328d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 24 deletions

View File

@ -45,7 +45,8 @@ test:
BINARY ?= external-dns
SOURCES = $(shell find . -name '*.go')
IMAGE ?= registry.opensource.zalan.do/teapot/$(BINARY)
IMAGE_STAGING = gcr.io/k8s-staging-external-dns/$(BINARY)
IMAGE ?= us.gcr.io/k8s-artifacts-prod/external-dns/$(BINARY)
VERSION ?= $(shell git describe --tags --always --dirty)
BUILD_FLAGS ?= -v
LDFLAGS ?= -X sigs.k8s.io/external-dns/pkg/apis/externaldns.Version=$(VERSION) -w -s
@ -66,3 +67,12 @@ build.mini:
clean:
@rm -rf build
# Builds and push container images to the staging bucket.
.PHONY: release.staging
release.staging:
IMAGE=$(IMAGE_STAGING) $(MAKE) build.docker build.push
release.prod:
$(MAKE) build.docker build.push

14
cloudbuild.yaml Normal file
View File

@ -0,0 +1,14 @@
# See https://cloud.google.com/cloud-build/docs/build-config
timeout: 1200s
steps:
- name: "gcr.io/k8s-testimages/gcb-docker-gcloud:v20190906-745fed4"
entrypoint: make
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
- TAG=$_GIT_TAG
args:
- release.staging
substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
# can be used as a substitution
_GIT_TAG: "12345"

View File

@ -1,23 +0,0 @@
version: "2017-09-20"
pipeline:
- id: build
overlay: ci/golang
cache:
paths:
- /go/pkg/mod # pkg cache for Go modules
- ~/.cache/go-build # Go build cache
type: script
commands:
- desc: build
cmd: |
make build.docker
- desc: push
cmd: |
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
IMAGE=registry-write.opensource.zalan.do/teapot/external-dns
VERSION=$(git describe --tags --always --dirty)
else
IMAGE=registry-write.opensource.zalan.do/teapot/external-dns-test
VERSION=$CDP_BUILD_VERSION
fi
IMAGE=$IMAGE VERSION=$VERSION make build.push