Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Commit

Permalink
Take SERVICE form environment variables, it support changing the imag…
Browse files Browse the repository at this point in the history
…e tag with environment variable
  • Loading branch information
Michael Filanov committed Mar 22, 2020
1 parent 6be6d92 commit a941f4d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PWD = $(shell pwd)
UID = $(shell id -u)

SERVICE = quay.io/mfilanov/bm-inventory:latest
SERVICE ?= quay.io/mfilanov/bm-inventory:latest

all: build

Expand Down Expand Up @@ -66,11 +66,14 @@ deploy-service-requirements: deploy-role

deploy-service-for-test: deploy-service-requirements
sed '/IMAGE_BUILDER_CMD$$/{$$!{N;s/IMAGE_BUILDER_CMD\n value: \"\"$$/IMAGE_BUILDER_CMD\n value: \"echo hello\"/;ty;P;D;:y}}' deploy/bm-inventory.yaml > deploy/bm-inventory-tmp.yaml
sed -i "s#REPLACE_IMAGE#${SERVICE}#g" deploy/bm-inventory-tmp.yaml
kubectl apply -f deploy/bm-inventory-tmp.yaml
rm deploy/bm-inventory-tmp.yaml

deploy-service: deploy-service-requirements
kubectl apply -f deploy/bm-inventory.yaml
sed "s#REPLACE_IMAGE#${SERVICE}#g" deploy/bm-inventory.yaml > deploy/bm-inventory-tmp.yaml
kubectl apply -f deploy/bm-inventory-tmp.yaml
rm deploy/bm-inventory-tmp.yaml

deploy-role:
kubectl apply -f deploy/roles/role_binding.yaml
Expand Down
2 changes: 1 addition & 1 deletion deploy/bm-inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: bm-inventory
image: quay.io/mfilanov/bm-inventory
image: REPLACE_IMAGE
imagePullPolicy: Always
ports:
- containerPort: 8090
Expand Down
2 changes: 2 additions & 0 deletions skipper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ volumes:
- $HOME/.kube/:$HOME/.kube
- /var/run/libvirt/libvirt-sock:/var/run/libvirt/libvirt-sock
- /var/lib/libvirt/:/var/lib/libvirt/
env:
SERVICE: $SERVICE

0 comments on commit a941f4d

Please sign in to comment.