github.com/munnerz/test-infra@v0.0.0-20190108210205-ce3d181dc989/label_sync/Makefile (about)

     1  # Copyright 2017 The Kubernetes Authors.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  all: bazel
    16  
    17  
    18  # TODO(fejta): deploy via bazel
    19  # These are the usual GKE variables.
    20  PROJECT       ?= k8s-prow
    21  ZONE          ?= us-central1-f
    22  CLUSTER       ?= prow
    23  
    24  bazel:
    25  	@echo Use bazel foo or ./planter/planter.sh bazel foo
    26  	@echo "  bazel build //label_sync/...  # build"
    27  	@echo "  bazel test //label_sync/...  # test"
    28  	@echo "  bazel run //label_sync:push  # push image"
    29  	@echo "  bazel run //label_sync:deploy # deploy"
    30  	@exit 1
    31  
    32  get-cluster-credentials:
    33  	gcloud container clusters get-credentials "$(CLUSTER)" --project="$(PROJECT)" --zone="$(ZONE)"
    34  
    35  update-config: get-cluster-credentials
    36  	# Oddy the first time requires creating it instead of replacing it...
    37  	kubectl create configmap label-config --from-file=labels.yaml=labels.yaml --dry-run -o yaml | kubectl replace configmap label-config -f -
    38  
    39  label_sync-job: get-cluster-credentials
    40  	kubectl apply -f cluster/label_sync_job.yaml
    41  
    42  label_sync-cronjob: get-cluster-credentials
    43  	kubectl apply -f cluster/label_sync_cron_job.yaml
    44  
    45  .PHONY: label_sync-job label_sync-cronjob bazel get-cluster-credentials