Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

Commit

Permalink
Revised to use varying release numbers assigned on config.env
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts committed Jul 30, 2015
1 parent cca31e8 commit 7738ede
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 81 deletions.
67 changes: 29 additions & 38 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,42 +49,42 @@ prod:

hubdb:
@ sudo mkdir -p $(PATH_MONGO_DB) $(PATH_MONGO_DUMP)
@ $(call dockerize,hubdb,$(DOCKER_HUBDB_PRODUCTION))
@ $(call dockerize,hubdb,$(DOCKER_HUBDB_PROD))
@ sudo docker exec hubdb /app/mongodb_init.sh > /dev/null


hub:
@ sudo mkdir -p $(PATH_HUB_AUTHKEYS) $(PATH_HUB_AUTOSSH)
@ $(call dockerize,hub,$(DOCKER_HUB_PRODUCTION))
@ $(call dockerize,hub,$(DOCKER_HUB_PROD))


auth:
@ sudo mkdir -p $(PATH_DACS)
@ $(call dockerize,auth,$(DOCKER_AUTH_PRODUCTION))
@ $(call dockerize,auth,$(DOCKER_AUTH_PROD))


dclapi:
@ sudo mkdir -p $(PATH_DRUGREF)
@ $(call dockerize,dclapi,$(DOCKER_DCLAPI_PRODUCTION))
@ $(call dockerize,dclapi,$(DOCKER_DCLAPI_PROD))


hapi:
@ $(call dockerize,hapi,$(DOCKER_HAPI_PRODUCTION))
@ $(call dockerize,hapi,$(DOCKER_HAPI_PROD))


viz:
@ sudo mkdir -p $(PATH_CERT)
@ $(call dockerize,viz,$(DOCKER_VIZ_PRODUCTION))
@ $(call dockerize,viz,$(DOCKER_VIZ_PROD))


ep-sample:
@ sudo mkdir -p $(PATH_EPX_AUTOSSH)
@ $(call dockerize,endpoint,$(DOCKER_ENDPOINT_PRODUCTION),0)
@ $(call dockerize,endpoint,$(DOCKER_ENDPOINT_PROD),0)
@ $(call config_ep,0,cpsid,cpsid,admin,TEST,sample)


queries:
@ $(call dockerize,queries,$(DOCKER_QI_PRODUCTION))
@ $(call dockerize,queries,$(DOCKER_QI_PROD))
@ sudo docker logs -f queries
@ $(call docker_remove,queries)

Expand All @@ -107,7 +107,7 @@ ep:
echo "Usage: make ep [gID=#] [DOCTOR=#####] [op:JURISDUCTION] [op:ROLE] [op:PASSWORD]"; \
echo; \
else \
$(call dockerize_ep,endpoint,$(DOCKER_ENDPOINT_PRODUCTION),$(gID)); \
$(call dockerize_ep,endpoint,$(DOCKER_ENDPOINT_PROD),$(gID)); \
$(call config_ep,$(gID),$(DOCTOR),$(ROLE),$(JURISDICTION),$(PASSWORD)); \
fi

Expand Down Expand Up @@ -493,40 +493,31 @@ endef
include config.env


# Set branch defaults
# Override branch defaults for non-production modes
#
ifeq ($(BUILD_MODE), dev)
BRANCH_DEFAULT = dev
else ifeq ($(BUILD_MODE), master)
BRANCH_DEFAULT = master
else
BRANCH_DEFAULT = $(RELEASE_VERSION)
ifneq ($(BUILD_MODE), prod)
BRANCH_AUTH ?= $(BUILD_MODE)
BRANCH_DCLAPI ?= $(BUILD_MODE)
BRANCH_ENDPOINT ?= $(BUILD_MODE)
BRANCH_EPXCLOUD ?= $(BUILD_MODE)
BRANCH_HAPI ?= $(BUILD_MODE)
BRANCH_HUB ?= $(BUILD_MODE)
BRANCH_HUBDB ?= $(BUILD_MODE)
BRANCH_QI ?= $(BUILD_MODE)
BRANCH_VIZ ?= $(BUILD_MODE)
endif


# Append Docker run commands for non-production modes
#
ifneq ($(BUILD_MODE), prod)
DOCKER_AUTH_PRODUCTION += $(DOCKER_AUTH_DEV_APPEND)
DOCKER_DCLAPI_PRODUCTION += $(DOCKER_DCLAPI_DEV_APPEND)
DOCKER_ENDPOINT_PRODUCTION += $(DOCKER_ENDPOINT_DEV_APPEND)
DOCKER_EPXCLOUD_PRODUCTION += $(DOCKER_ENDPOINT_DEV_APPEND)
DOCKER_HAPI_PRODUCTION += $(DOCKER_HAPI_DEV_APPEND)
DOCKER_HUB_PRODUCTION += $(DOCKER_HUB_DEV_APPEND)
DOCKER_HUBDB_PRODUCTION += $(DOCKER_HUBDB_DEV_APPEND)
DOCKER_QI_PRODUCTION += $(DOCKER_QI_DEV_APPEND)
DOCKER_VIZ_PRODUCTION += $(DOCKER_VIZ_DEV_APPEND)
DOCKER_AUTH_PROD += $(DOCKER_AUTH_JOIN)
DOCKER_DCLAPI_PROD += $(DOCKER_DCLAPI_JOIN)
DOCKER_ENDPOINT_PROD += $(DOCKER_ENDPOINT_JOIN)
DOCKER_EPXCLOUD_PROD += $(DOCKER_ENDPOINT_JOIN)
DOCKER_HAPI_PROD += $(DOCKER_HAPI_JOIN)
DOCKER_HUB_PROD += $(DOCKER_HUB_JOIN)
DOCKER_HUBDB_PROD += $(DOCKER_HUBDB_JOIN)
DOCKER_QI_PROD += $(DOCKER_QI_JOIN)
DOCKER_VIZ_PROD += $(DOCKER_VIZ_JOIN)
endif


# Use branch defaults where overrides are not provided
#
BRANCH_AUTH ?= $(BRANCH_DEFAULT)
BRANCH_DCLAPI ?= $(BRANCH_DEFAULT)
BRANCH_ENDPOINT ?= $(BRANCH_DEFAULT)
BRANCH_EPXCLOUD ?= $(BRANCH_DEFAULT)
BRANCH_HAPI ?= $(BRANCH_DEFAULT)
BRANCH_HUB ?= $(BRANCH_DEFAULT)
BRANCH_HUBDB ?= $(BRANCH_DEFAULT)
BRANCH_QI ?= $(BRANCH_DEFAULT)
BRANCH_VIZ ?= $(BRANCH_DEFAULT)
81 changes: 38 additions & 43 deletions config.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,26 @@
BUILD_MODE=prod


# Release
#
RELEASE_VERSION=0.1.1


# Hub external IP/Address (10.0.2.2 for Vagrant/VirtualBox)
#
URL_HUB=hub.pdc.io
URL_HUB=10.0.2.2


# Notification addresses
# GitHub branch overrides
#
EMAIL_ERRORS=[email protected]
# Comment out to accept branch assigned by ${BUILD_MODE}
#
# (Note: do not leave blank values!)
#
BRANCH_AUTH=0.1.2
BRANCH_DCLAPI=0.1.1
BRANCH_ENDPOINT=0.1.2
BRANCH_EPXCLOUD=0.1.1
BRANCH_HAPI=0.1.2
BRANCH_HUB=0.1.1
BRANCH_HUBDB=0.1.2
BRANCH_QI=0.1.1
BRANCH_VIZ=0.1.2


# ownCloud backup details
Expand All @@ -31,23 +38,6 @@ OWNCLOUD_PW=<password>
OWNCLOUD_URL=<https://...>


# GitHub branch overrides
#
# Comment out to accept branch assigned by ${BUILD_MODE}
#
# (Note: do not leave blank values!)
#
#BRANCH_AUTH=master
#BRANCH_DCLAPI=master
#BRANCH_ENDPOINT=master
#BRANCH_EP=master
#BRANCH_HAPI=master
#BRANCH_HUB=master
#BRANCH_HUBDB=master
#BRANCH_QI=master
#BRANCH_VIZ=master


# DACS
#
DACS_STOREDIR=/etc/dacs
Expand All @@ -60,6 +50,11 @@ DACS_JURISDICTION=TEST
PATH_HOST=/pdc/data


# Notification addresses
#
EMAIL_ERRORS=[email protected]


# Node.js
#
NODE_TLS_REJECT_UNAUTHORIZED=0
Expand Down Expand Up @@ -136,29 +131,29 @@ DACS_ROLEFILE=/etc/dacs/federations/pdc.dev/roles

# Containers
#
DOCKER_AUTH_PRODUCTION=-v ${PATH_DACS}:${DACS_STOREDIR}/:rw
DOCKER_AUTH_DEV_APPEND=-p ${PORT_AUTH_M}:${PORT_AUTH_M} -p ${PORT_AUTH_C}:${PORT_AUTH_C}
DOCKER_AUTH_PROD=-v ${PATH_DACS}:${DACS_STOREDIR}/:rw
DOCKER_AUTH_SUPPLEMENT=-p ${PORT_AUTH_M}:${PORT_AUTH_M} -p ${PORT_AUTH_C}:${PORT_AUTH_C}
#
DOCKER_DCLAPI_PRODUCTION=-v ${PATH_DRUGREF}:/app/drugref/
DOCKER_DCLAPI_DEV_APPEND=-p ${PORT_DACS}:${PORT_DACS}
DOCKER_DCLAPI_PROD=-v ${PATH_DRUGREF}:/app/drugref/
DOCKER_DCLAPI_JOIN=-p ${PORT_DACS}:${PORT_DACS}
#
DOCKER_ENDPOINT_PRODUCTION=-v $(PATH_EPX_AUTOSSH):/root/.ssh/:rw
DOCKER_ENDPOINT_DEV_APPEND=
DOCKER_ENDPOINT_PROD=-v $(PATH_EPX_AUTOSSH):/root/.ssh/:rw
DOCKER_ENDPOINT_JOIN=
#
DOCKER_EPXCLOUD_PRODUCTION=-v $(PATH_EPX_AUTOSSH):/root/.ssh/:ro
DOCKER_EPXCLOUD_DEV_APPEND=
DOCKER_EPXCLOUD_PROD=-v $(PATH_EPX_AUTOSSH):/root/.ssh/:ro
DOCKER_EPXCLOUD_JOIN=
#
DOCKER_HAPI_PRODUCTION=--link auth:auth --link hubdb:hubdb --link dclapi:dclapi
DOCKER_HAPI_DEV_APPEND=-p ${PORT_HAPI}:${PORT_HAPI}
DOCKER_HAPI_PROD=--link auth:auth --link hubdb:hubdb --link dclapi:dclapi
DOCKER_HAPI_JOIN=-p ${PORT_HAPI}:${PORT_HAPI}
#
DOCKER_HUB_PRODUCTION=--link hubdb:hubdb -v ${PATH_HUB_AUTOSSH}:/home/autossh/.ssh/:rw -v ${PATH_HUB_AUTHKEYS}:/etc/ssh/:rw -p ${PORT_AUTOSSH}:22 -p ${PORT_HUB_WEB}:3002
DOCKER_HUB_DEV_APPEND=
DOCKER_HUB_PROD=--link hubdb:hubdb -v ${PATH_HUB_AUTOSSH}:/home/autossh/.ssh/:rw -v ${PATH_HUB_AUTHKEYS}:/etc/ssh/:rw -p ${PORT_AUTOSSH}:22 -p ${PORT_HUB_WEB}:3002
DOCKER_HUB_JOIN=
#
DOCKER_HUBDB_PRODUCTION=-v ${PATH_MONGO_DB}:/data/db/:rw -v ${PATH_MONGO_DUMP}:/data/dump/:rw
DOCKER_HUBDB_DEV_APPEND=-p ${PORT_MONGO}:27017
DOCKER_HUBDB_PROD=-v ${PATH_MONGO_DB}:/data/db/:rw -v ${PATH_MONGO_DUMP}:/data/dump/:rw
DOCKER_HUBDB_JOIN=-p ${PORT_MONGO}:27017
#
DOCKER_QI_PRODUCTION=--link hubdb:hubdb
DOCKER_QI_DEV_APPEND=
DOCKER_QI_PROD=--link hubdb:hubdb
DOCKER_QI_JOIN=
#
DOCKER_VIZ_PRODUCTION=--link auth:auth --link hapi:hapi -p 443:${PORT_VIZ} -v ${PATH_CERT}:/app/cert/:ro
DOCKER_VIZ_DEV_APPEND=-p ${PORT_VIZ}:${PORT_VIZ}
DOCKER_VIZ_PROD=--link auth:auth --link hapi:hapi -p 443:${PORT_VIZ} -v ${PATH_CERT}:/app/cert/:ro
DOCKER_VIZ_JOIN=-p ${PORT_VIZ}:${PORT_VIZ}

0 comments on commit 7738ede

Please sign in to comment.