jupyterhub-deploy-docker/Makefile
Bryan W. Weber 8d887f7a38
Add oauth.env target to Makefile
Since 6917060, docker compose relies on an oauth.env file to get
the OAuth parameters, so the Makefile is updated to handle here
this change. In addition, the README is updated.
2017-08-23 09:22:45 -04:00

59 lines
1.5 KiB
Makefile

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
include .env
.DEFAULT_GOAL=build
network:
@docker network inspect $(DOCKER_NETWORK_NAME) >/dev/null 2>&1 || docker network create $(DOCKER_NETWORK_NAME)
volumes:
@docker volume inspect $(DATA_VOLUME_HOST) >/dev/null 2>&1 || docker volume create --name $(DATA_VOLUME_HOST)
@docker volume inspect $(DB_VOLUME_HOST) >/dev/null 2>&1 || docker volume create --name $(DB_VOLUME_HOST)
self-signed-cert:
# make a self-signed cert
secrets/postgres.env:
@echo "Generating postgres password in $@"
@echo "POSTGRES_PASSWORD=$(shell openssl rand -hex 32)" > $@
secrets/oauth.env:
@echo "Need oauth.env file in secrets with GitHub parameters"
@exit 1
secrets/jupyterhub.crt:
@echo "Need an SSL certificate in secrets/jupyterhub.crt"
@exit 1
secrets/jupyterhub.key:
@echo "Need an SSL key in secrets/jupyterhub.key"
@exit 1
userlist:
@echo "Add usernames, one per line, to ./userlist, such as:"
@echo " zoe admin"
@echo " wash"
@exit 1
# Do not require cert/key files if SECRETS_VOLUME defined
secrets_volume = $(shell echo $(SECRETS_VOLUME))
ifeq ($(secrets_volume),)
cert_files=secrets/jupyterhub.crt secrets/jupyterhub.key
else
cert_files=
endif
check-files: userlist $(cert_files) secrets/oauth.env secrets/postgres.env
pull:
docker pull $(DOCKER_NOTEBOOK_IMAGE)
notebook_image: pull
build: check-files network volumes
docker-compose build
.PHONY: network volumes check-files pull notebook_image build