-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from mbarnes/frontend-make-targets
Move frontend-specific make targets to frontend/Makefile
- Loading branch information
Showing
4 changed files
with
61 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,66 @@ | ||
SHELL = /bin/bash | ||
COMMIT = $(shell git rev-parse --short=7 HEAD)$(shell [[ $$(git status --porcelain) = "" ]] || echo -dirty) | ||
ARO_HCP_BASE_IMAGE ?= ${ARO_HCP_IMAGE_ACR}.azurecr.io | ||
ARO_HCP_FRONTEND_IMAGE ?= $(ARO_HCP_BASE_IMAGE)/arohcpfrontend:$(COMMIT) | ||
|
||
# for deploying frontend into private aks cluster via invoke command | ||
# these values must be set | ||
RESOURCE_GROUP ?= | ||
CLUSTER_NAME ?= | ||
|
||
.PHONY: frontend clean | ||
frontend: | ||
go build -o aro-hcp-frontend . | ||
|
||
clean: | ||
rm -f aro-hcp-frontend | ||
|
||
image: | ||
pushd .. && git archive --output frontend/archive.tar.gz HEAD && popd | ||
docker build --platform="linux/amd64" -f "./Dockerfile" -t ${ARO_HCP_FRONTEND_IMAGE} . | ||
rm -f archive.tar.gz | ||
|
||
deploy: | ||
@test "${RESOURCE_GROUP}" != "" || (echo "RESOURCE_GROUP must be defined" && exit 1) | ||
FRONTEND_MI_CLIENT_ID=$(shell az deployment group show \ | ||
-g ${RESOURCE_GROUP} \ | ||
-n "hcp-${USER}-dev-infra" \ | ||
--query properties.outputs.frontend_mi_client_id.value);\ | ||
oc process -f ./deploy/aro-hcp-frontend.yml --local \ | ||
-p ARO_HCP_FRONTEND_IMAGE=${ARO_HCP_FRONTEND_IMAGE} \ | ||
-p FRONTEND_MI_CLIENT_ID="$${FRONTEND_MI_CLIENT_ID}" | oc apply -f - | ||
|
||
undeploy: | ||
@test "${RESOURCE_GROUP}" != "" || (echo "RESOURCE_GROUP must be defined" && exit 1) | ||
FRONTEND_MI_CLIENT_ID=$(shell az deployment group show \ | ||
-g ${RESOURCE_GROUP} \ | ||
-n "hcp-${USER}-dev-infra" \ | ||
--query properties.outputs.frontend_mi_client_id.value);\ | ||
oc process -f ./deploy/aro-hcp-frontend.yml --local \ | ||
-p ARO_HCP_FRONTEND_IMAGE=${ARO_HCP_FRONTEND_IMAGE} \ | ||
-p FRONTEND_MI_CLIENT_ID="$${FRONTEND_MI_CLIENT_ID}" | oc delete -f - | ||
|
||
deploy-private: | ||
@test "${RESOURCE_GROUP}" != "" && test "${CLUSTER_NAME}" != "" || (echo "RESOURCE_GROUP and CLUSTER_NAME must be defined" && exit 1) | ||
TMP_DEPLOY=$(shell mktemp);\ | ||
FRONTEND_MI_CLIENT_ID=$(shell az deployment group show \ | ||
-g ${RESOURCE_GROUP} \ | ||
-n "hcp-${USER}-dev-infra" \ | ||
--query properties.outputs.frontend_mi_client_id.value);\ | ||
oc process -f ./deploy/aro-hcp-frontend.yml --local \ | ||
-p ARO_HCP_FRONTEND_IMAGE=${ARO_HCP_FRONTEND_IMAGE} \ | ||
-p FRONTEND_MI_CLIENT_ID="$${FRONTEND_MI_CLIENT_ID}" > "$${TMP_DEPLOY}";\ | ||
az aks command invoke --resource-group ${RESOURCE_GROUP} --name ${CLUSTER_NAME} --command "kubectl create -f $$(basename $${TMP_DEPLOY})" --file "$${TMP_DEPLOY}" | ||
|
||
undeploy-private: | ||
@test "${RESOURCE_GROUP}" != "" && test "${CLUSTER_NAME}" != "" || (echo "RESOURCE_GROUP and CLUSTER_NAME must be defined" && exit 1) | ||
TMP_DEPLOY=$(shell mktemp);\ | ||
FRONTEND_MI_CLIENT_ID=$(shell az deployment group show \ | ||
-g ${RESOURCE_GROUP} \ | ||
-n "hcp-${USER}-dev-infra" \ | ||
--query properties.outputs.frontend_mi_client_id.value);\ | ||
oc process -f ./deploy/aro-hcp-frontend.yml --local \ | ||
-p ARO_HCP_FRONTEND_IMAGE=${ARO_HCP_FRONTEND_IMAGE} \ | ||
-p FRONTEND_MI_CLIENT_ID="$${FRONTEND_MI_CLIENT_ID}" > "$${TMP_DEPLOY}";\ | ||
az aks command invoke --resource-group ${RESOURCE_GROUP} --name ${CLUSTER_NAME} --command "kubectl delete -f $$(basename $${TMP_DEPLOY})" --file "$${TMP_DEPLOY}" | ||
|
||
.PHONY: frontend clean image deploy undeploy deploy-private undeploy-private |
File renamed without changes.