2017-02-07 15:18:47 +00:00
|
|
|
# Copyright 2017 The Kubernetes Authors.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
# Build the etcd-version-monitor image
|
|
|
|
#
|
|
|
|
# Usage:
|
Switch to k8s.gcr.io vanity domain
This is the 2nd attempt. The previous was reverted while we figured out
the regional mirrors (oops).
New plan: k8s.gcr.io is a read-only facade that auto-detects your source
region (us, eu, or asia for now) and pulls from the closest. To publish
an image, push k8s-staging.gcr.io and it will be synced to the regionals
automatically (similar to today). For now the staging is an alias to
gcr.io/google_containers (the legacy URL).
When we move off of google-owned projects (working on it), then we just
do a one-time sync, and change the google-internal config, and nobody
outside should notice.
We can, in parallel, change the auto-sync into a manual sync - send a PR
to "promote" something from staging, and a bot activates it. Nice and
visible, easy to keep track of.
2018-01-17 19:36:53 +00:00
|
|
|
# [GOLANG_VERSION=1.8.3] [REGISTRY=staging-k8s.gcr.io] [TAG=test] make (build|push)
|
2017-02-07 15:18:47 +00:00
|
|
|
# TODO(shyamjvs): Support architectures other than amd64 if needed.
|
|
|
|
ARCH:=amd64
|
2017-05-25 09:07:46 +00:00
|
|
|
GOLANG_VERSION?=1.8.3
|
Switch to k8s.gcr.io vanity domain
This is the 2nd attempt. The previous was reverted while we figured out
the regional mirrors (oops).
New plan: k8s.gcr.io is a read-only facade that auto-detects your source
region (us, eu, or asia for now) and pulls from the closest. To publish
an image, push k8s-staging.gcr.io and it will be synced to the regionals
automatically (similar to today). For now the staging is an alias to
gcr.io/google_containers (the legacy URL).
When we move off of google-owned projects (working on it), then we just
do a one-time sync, and change the google-internal config, and nobody
outside should notice.
We can, in parallel, change the auto-sync into a manual sync - send a PR
to "promote" something from staging, and a bot activates it. Nice and
visible, easy to keep track of.
2018-01-17 19:36:53 +00:00
|
|
|
REGISTRY?=staging-k8s.gcr.io
|
2018-02-15 00:54:43 +00:00
|
|
|
TAG?=0.1.2
|
2017-02-07 15:18:47 +00:00
|
|
|
IMAGE:=$(REGISTRY)/etcd-version-monitor:$(TAG)
|
|
|
|
CURRENT_DIR:=$(pwd)
|
|
|
|
TEMP_DIR:=$(shell mktemp -d)
|
|
|
|
|
|
|
|
build:
|
|
|
|
# Copy the necessary files for building the image to TEMP_DIR.
|
|
|
|
cp etcd-version-monitor.go Dockerfile $(TEMP_DIR)
|
|
|
|
|
|
|
|
# Compile etcd-version-monitor.
|
Switch to k8s.gcr.io vanity domain
This is the 2nd attempt. The previous was reverted while we figured out
the regional mirrors (oops).
New plan: k8s.gcr.io is a read-only facade that auto-detects your source
region (us, eu, or asia for now) and pulls from the closest. To publish
an image, push k8s-staging.gcr.io and it will be synced to the regionals
automatically (similar to today). For now the staging is an alias to
gcr.io/google_containers (the legacy URL).
When we move off of google-owned projects (working on it), then we just
do a one-time sync, and change the google-internal config, and nobody
outside should notice.
We can, in parallel, change the auto-sync into a manual sync - send a PR
to "promote" something from staging, and a bot activates it. Nice and
visible, easy to keep track of.
2018-01-17 19:36:53 +00:00
|
|
|
docker run -it \
|
|
|
|
-v $(shell pwd)/../../../:/go/src/k8s.io/kubernetes \
|
|
|
|
-v $(TEMP_DIR):/build \
|
|
|
|
-e GOARCH=$(ARCH) \
|
|
|
|
golang:$(GOLANG_VERSION) \
|
|
|
|
/bin/bash -c "CGO_ENABLED=0 go build -o /build/etcd-version-monitor k8s.io/kubernetes/cluster/images/etcd-version-monitor"
|
2017-02-07 15:18:47 +00:00
|
|
|
|
|
|
|
docker build -t $(IMAGE) $(TEMP_DIR)
|
|
|
|
|
|
|
|
push: build
|
2018-02-24 05:54:24 +00:00
|
|
|
docker push $(IMAGE)
|
2017-02-07 15:18:47 +00:00
|
|
|
|
|
|
|
all: build
|
|
|
|
|
|
|
|
.PHONY: build push
|