Please specify the appropriate identifier for your container registry; defaults to whoami
. This variable should be changed prior to attempting to push
a Docker image.
This variable controls which organization services and patterns are directed. This variable should be changed prior to attempting to service-publish
or pattern-publish
.
These variables control identification and naming as well as architecture for build:
TAG
- tag, if any, for build artefacts; defaults to empty unlessTAG
file found or specified as environment variableBUILD_ARCH
- defined in thebuild.json
configuration file
They may be used on the command-line to control the build, for example:
% make BUILD_ARCH=arm64 TAG=test publish-service
These variables indicate the files used for code signing. These files are generated using the hzn
command-line-interface and preferably stored in the open-horizon/
directory. These keys are necessary for any service-publish
or pattern-publish
targets.
PRIVATE_KEY_FILE
- filename of private key for code signing; defaults toIBM-*.key
orPRIVATE_KEY_FILE
PUBLIC_KEY_FILE
- filename of public key for code signing; defaults toIBM-*.pem
orPUBLIC_KEY_FILE
Use the following command with appropriate alternatives; any values are acceptable:
hzn key create ${HZN_ORG_ID} ${USER}@${HOST}
mv -f *.key ${HZN_ORG_ID}.key
mv -f *.pem ${HZN_ORG_ID}.pem
This variable provides the IBM Cloud API key; it is the contents of the APIKEY
file which itself is derived fromapiKey
if an IBM Cloud API key JSON file is stored in open-horizon/apiKey.json
IBM Cloud API keys can be generated and downloaded from the IBM Cloud IAM
service.
APIKEY
- contents ofAPIKEY
file; created fromapiKey
inapiKey.json
SERVICE_ORG
- organization for service; defaults toorg
fromservice.json
SERVICE_LABEL
- label for service; defaults tolabel
fromservice.json
SERVICE_NAME
- name to use for service artefacts w/TAG
if exists; defaults toSERVICE_LABEL
SERVICE_VERSION
- semantic version#.#.#
for service; defaults toversion
fromservice.json
SERVICE_TAG
- identifier for service as recorded in Open Horizon exchangeSERVICE_PORT
- status port for service; identified as first entry fromspecific_ports
inservice.json
SERVICE_URI
- unique identifier for service in exchange; defaults tourl
fromservice.json
SERVICE_URL
- unique identifier for service in exchange w/TAG
if exists; defaults toSERVICE_URI
SERVICE_REQVARS
- list of required variables fromservice.json
DOCKER_NAMESPACE
- identifier for login to container registry; defaults to output ofwhoami
DOCKER_NAME
- identifier for container; defaults to${BUILD_ARCH}/${SERVICE_NAME}
DOCKER_TAG
- tag for container; defaults to$(DOCKER_ID)/$(DOCKER_NAME):$(SERVICE_VERSION)
DOCKER_PORT
- port mapping for local container; from default is first fromports
inservice.json
These variables control the testing of the service or pattern:
TEST_JQ_FILTER
- filter to apply tojq
command when testing the service; defaults to first line ofTEST_JQ_FILTER
fileTEST_NODE_FILTER
- filter to apply when testing nodes; defaults to first line ofTEST_NODE_FILTER
fileTEST_NODE_TIMEOUT
- number of seconds to wait for a node connectionTEST_NODE_NAMES
- list of nodes or contents of fileTEST_TMP_MACHINES
; defaults tolocalhost
TEST_JQ_FILTER ?= $(if $(wildcard TEST_JQ_FILTER),$(shell head -1 TEST_JQ_FILTER),)
TEST_NODE_FILTER ?= $(if $(wildcard TEST_NODE_FILTER),$(shell head -1 TEST_NODE_FILTER),)
TEST_TIMEOUT = 10
TEST_NODE_NAMES = $(if $(wildcard TEST_TMP_MACHINES),$(shell cat TEST_TMP_MACHINES),localhost)
These variables are complicated and subject to change.
Define BUILD_FROM
according to TAG
if and only if the original BUILD_BASE
is from the same DOCKER_ID
(i.e. use base images with same TAG
).
BUILD_BASE=$(shell jq -r ".build_from.${BUILD_ARCH}" build.json)
BUILD_ORG=$(shell echo $(BUILD_BASE) | sed "s|\([^/]*\)/.*|\1|")
SAME_ORG=$(shell if [ $(BUILD_ORG) = $(DOCKER_ID) ]; then echo ${DOCKER_ID}; else echo ""; fi)
BUILD_PKG=$(shell echo $(BUILD_BASE) | sed "s|[^/]*/\([^:]*\):.*|\1|")
BUILD_TAG=$(shell echo $(BUILD_BASE) | sed "s|[^/]*/[^:]*:\(.*\)|\1|")
BUILD_FROM=$(if ${TAG},$(if ${SAME_ORG},${BUILD_ORG}/${BUILD_PKG}-${TAG}:${BUILD_TAG},${BUILD_BASE}),${BUILD_BASE})