Default PubNub and Mixpanel keys are now passed at build time

This commit is contained in:
Pablo Carranza Vélez 2015-10-14 16:53:33 -03:00
parent ae6b042318
commit 33d402c3c0
4 changed files with 28 additions and 5 deletions

View File

@ -1,3 +1,5 @@
* Remove default Pubnub and Mixpanel keys as they are now passed at build time [Pablo]
# v1.1.0
* Switch back to using arch-based node images [Pablo]

View File

@ -12,6 +12,10 @@ all: supervisor
IMAGE = "resin/$(ARCH)-supervisor:$(SUPERVISOR_VERSION)"
SUPERVISOR_IMAGE=$(DEPLOY_REGISTRY)$(IMAGE)
PUBNUB_SUBSCRIBE_KEY = sub-c-bananas
PUBNUB_PUBLISH_KEY = pub-c-bananas
MIXPANEL_TOKEN = bananasbananas
ifeq ($(ARCH),rpi)
GOARCH = arm
endif
@ -54,6 +58,9 @@ stop-supervisor:
supervisor: gosuper
cp Dockerfile.$(ARCH) Dockerfile
echo "ENV VERSION "`jq -r .version package.json` >> Dockerfile
echo "ENV PUBNUB_PUBLISH_KEY $(PUBNUB_PUBLISH_KEY)" >> Dockerfile
echo "ENV PUBNUB_SUBSCRIBE_KEY $(PUBNUB_SUBSCRIBE_KEY)" >> Dockerfile
echo "ENV MIXPANEL_TOKEN $(MIXPANEL_TOKEN)" >> Dockerfile
docker build --no-cache=$(DISABLE_CACHE) -t $(IMAGE) .
-rm Dockerfile

View File

@ -12,5 +12,19 @@ docker pull resin/${ARCH}-supervisor:${ESCAPED_BRANCH_NAME} || docker pull resin
make SUPERVISOR_VERSION=${VERSION} JOB_NAME=${JOB_NAME} test-gosuper
# Build the images
make SUPERVISOR_VERSION=${ESCAPED_BRANCH_NAME} ARCH=${ARCH} JOB_NAME=${JOB_NAME} DEPLOY_REGISTRY= deploy
make SUPERVISOR_VERSION=${VERSION} ARCH=${ARCH} JOB_NAME=${JOB_NAME} DEPLOY_REGISTRY= deploy
make SUPERVISOR_VERSION=${ESCAPED_BRANCH_NAME} \
ARCH=${ARCH} \
JOB_NAME=${JOB_NAME} \
DEPLOY_REGISTRY= \
PUBNUB_SUBSCRIBE_KEY=${PUBNUB_SUBSCRIBE_KEY} \
PUBNUB_PUBLISH_KEY=${PUBNUB_PUBLISH_KEY} \
MIXPANEL_TOKEN=${MIXPANEL_TOKEN} \
deploy
make SUPERVISOR_VERSION=${VERSION} \
ARCH=${ARCH} \
JOB_NAME=${JOB_NAME} \
DEPLOY_REGISTRY= \
PUBNUB_SUBSCRIBE_KEY=${PUBNUB_SUBSCRIBE_KEY} \
PUBNUB_PUBLISH_KEY=${PUBNUB_PUBLISH_KEY} \
MIXPANEL_TOKEN=${MIXPANEL_TOKEN} \
deploy

View File

@ -13,9 +13,9 @@ module.exports = config =
gosuperAddress: "http://unix:#{process.env.GOSUPER_SOCKET}:"
registryEndpoint: process.env.REGISTRY_ENDPOINT ? 'registry.resin.io'
pubnub:
subscribe_key: process.env.PUBNUB_SUBSCRIBE_KEY ? 'sub-c-bananas'
publish_key: process.env.PUBNUB_PUBLISH_KEY ? 'pub-c-bananas'
mixpanelToken: process.env.MIXPANEL_TOKEN ? 'bananasbananas'
subscribe_key: process.env.PUBNUB_SUBSCRIBE_KEY ? ''
publish_key: process.env.PUBNUB_PUBLISH_KEY ? ''
mixpanelToken: process.env.MIXPANEL_TOKEN ? ''
dockerSocket: process.env.DOCKER_SOCKET ? '/run/docker.sock'
supervisorImage: process.env.SUPERVISOR_IMAGE ? 'resin/rpi-supervisor'
configMountPoint: process.env.CONFIG_MOUNT_POINT ? '/mnt/mmcblk0p1/config.json'