forked from Azure-Samples/mslearn-aks-app-scaling-keda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
28 lines (23 loc) · 826 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
ENV ?= dev
ACR := pplavetzki
AUTO_NAME ?= ${ACR}.azurecr.io/${ENV}
# TAG := $(shell date +"%Y%m%d.${GITHUB_RUN_NUMBER}")
TAG := $(shell git rev-parse HEAD | cut -c 1-8)
TEN := $(TENANT)
SP_PSW := $(SP_PASSWORD)
SECRETS ?= .secrets.sh
.PHONY: az-login
az-login:
@echo "Logging into Azure"
@az login --service-principal -u $(APPLICATION_ID) -p ${SP_PSW} --tenant ${TEN} > /dev/null
.PHONY: docker-login
docker-login: az-login
@az acr login --name $(ACR).azurecr.io -u $(APPLICATION_ID) -p ${SP_PSW}
.PHONY: build-image
build-image:
docker build -t ${AUTO_NAME}/redis-client:${TAG} -f Dockerfile .
docker tag ${AUTO_NAME}/redis-client:${TAG} ${AUTO_NAME}/redis-client:latest
.PHONY: publish
publish: docker-login
docker push ${AUTO_NAME}/redis-client:${TAG}
docker push ${AUTO_NAME}/redis-client:latest