Skip to content

Commit

Permalink
make deploy should use provided COMMIT as tag or use the most recent tag
Browse files Browse the repository at this point in the history
COMMIT is provided in the confif file for any environment that is not
development. For these, the behavior do not change

If COMMIT is not provided, we query azure ACR for the most recent tag
and use that.
  • Loading branch information
jfchevrette committed Dec 20, 2024
1 parent b6c5808 commit 3dfa2ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions backend/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
-include ../setup-env.mk

ifndef COMMIT
COMMIT := $(shell git rev-parse --short=7 HEAD)
ARO_HCP_REGISTRY ?= ${ARO_HCP_IMAGE_ACR}.azurecr.io
ARO_HCP_REPOSITORY := arohcpbackend

ifeq ($(strip $(COMMIT)),)
COMMIT := $(shell az acr repository show-tags --name ${ARO_HCP_IMAGE_ACR} --repository ${ARO_HCP_REPOSITORY} --orderby time_desc --top 1 --output tsv)
endif
ARO_HCP_BASE_IMAGE ?= ${ARO_HCP_IMAGE_ACR}.azurecr.io
ARO_HCP_BACKEND_IMAGE ?= $(ARO_HCP_BASE_IMAGE)/arohcpbackend:$(COMMIT)
ARO_HCP_BACKEND_IMAGE ?= $(ARO_HCP_REGISTRY)/$(ARO_HCP_REPOSITORY):$(COMMIT)

.DEFAULT_GOAL := backend

Expand Down
10 changes: 6 additions & 4 deletions frontend/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
-include ../setup-env.mk

ifndef COMMIT
COMMIT := $(shell git rev-parse --short=7 HEAD)
ARO_HCP_REGISTRY ?= ${ARO_HCP_IMAGE_ACR}.azurecr.io
ARO_HCP_REPOSITORY := arohcpfrontend

ifeq ($(strip $(COMMIT)),)
COMMIT := $(shell az acr repository show-tags --name ${ARO_HCP_IMAGE_ACR} --repository ${ARO_HCP_REPOSITORY} --orderby time_desc --top 1 --output tsv)
endif
ARO_HCP_BASE_IMAGE ?= ${ARO_HCP_IMAGE_ACR}.azurecr.io
ARO_HCP_FRONTEND_IMAGE ?= $(ARO_HCP_BASE_IMAGE)/arohcpfrontend:$(COMMIT)
ARO_HCP_FRONTEND_IMAGE ?= $(ARO_HCP_REGISTRY)/$(ARO_HCP_REPOSITORY):$(COMMIT)

.DEFAULT_GOAL := frontend

Expand Down

0 comments on commit 3dfa2ab

Please sign in to comment.