Skip to content
Snippets Groups Projects
makefile.mk 2.17 KiB
Newer Older
Adam Lewenberg's avatar
Adam Lewenberg committed
## >>> DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! <<<
##
## This file created by otica from otica.yaml and will be
## overwritten the next time it is run.
##
## Put local Makefile targets in common/makefile_parts/something.mk
##
## >>> DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! DO NOT EDIT! <<<

THIS_MAKEFILE := $(realpath $(lastword $(MAKEFILE_LIST)))
PATH := ${SCRIPTS_DIR}:${PATH}

# These are subdirectories of the Otica project:
ifndef COMMON
	COMMON := ../common
endif
TEMPLATES := ${COMMON}/templates
DATA := ${DATA}/templates
SCRIPTS := ${SCRIPTS}/templates
ARTIFACTS := ${COMMON}/artifacts

## ENVIRONMENT VARIABLE FILES
include ${COMMON}/framework.var
include ${COMMON}/gcp-uit-et-iedo-services.var
include ${COMMON}/common.var
include local.var

# Export all variables:
export


# FRAMEWORK SYNC
ifeq ($(MAKELEVEL),0)
	ifndef SKIP_SYNC
		_ := $(shell >&2 echo)
		ifneq ($(wildcard ${FRAMEWORK_DIR}/.git/),)
			_ := $(shell >&2 echo Updating Otica cloud framework from Git into ${FRAMEWORK_DIR}...)
			_ := $(shell cd ${FRAMEWORK_DIR}; git pull ${FRAMEWORK_GIT_REMOTE} ${FRAMEWORK_GIT_BRANCH}; git checkout ${FRAMEWORK_GIT_BRANCH})
		else
			_ := $(shell >&2 echo Updating Otica cloud framework in ${FRAMEWORK_DIR}...)
			_ := $(shell mkdir -p ${FRAMEWORK_DIR} && curl --retry 3 -s https://storage.googleapis.com/${FRAMEWORK_BUCKET}/framework.tar.gz?random=$$(date +%s) | tar -xzf - -C ${FRAMEWORK_DIR})
			_ := $(shell >&2 echo - framework version: $$(cat ${FRAMEWORK_DIR}/sha.txt))
		endif
	endif
endif
# END FRAMEWORK SYNC

## FRAMEWORK-SUPPLIED MAKEFILES
include ${FRAMEWORK_DIR}/makefile_parts/framework.mk
include ${FRAMEWORK_DIR}/makefile_parts/vault.mk
include ${FRAMEWORK_DIR}/makefile_parts/config-gcp.mk
include ${FRAMEWORK_DIR}/makefile_parts/helm-develop.mk
## END OF FRAMEWORK-SUPPLIED MAKEFILES

## LOCAL MAKEFILES IN COMMON
## END OF LOCAL MAKEFILES

# Get the release channel name from git branches,
# i.e. alpha, beta, and stable
# note: master branch is mapped to 'stable'
ifndef COMMIT_BRANCH
	COMMIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
endif
export RELEASE_CHANNEL=$(shell echo ${COMMIT_BRANCH} | sed 's/master/stable/')