forked from everware/everware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
98 lines (84 loc) · 2.79 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Makefile for building & starting rep-containers
# arguments can be supplied by -e definitions:
#
# TESTS -- list of tests to run
# M -- commit message
#
#
SHELL := /bin/bash
TEST_OPTIONS := -s tests -N 2
TESTS := test_happy_mp
IP = $(shell python -c 'from IPython.utils.localinterfaces import public_ips; print (public_ips()[0])' 2>/dev/null)
OPTIONS = --debug --port 8000 --no-ssl --JupyterHub.hub_ip=${IP}
UPLOADDIR ?= ~/upload_screens
PYTHON_MAJOR = $(shell python -c 'import sys; print(sys.version_info[0])')
IS_PYTHON3 = $(shell which python3)
ifeq (${PYTHON_MAJOR}, 3)
PYTHON = python
PIP = pip
else ifdef IS_PYTHON3
PYTHON = python3
PIP = pip3
else
$(error Unable to find python)
endif
ifeq ($(shell uname -s),Linux)
SPAWNER_IP = "127.0.0.1"
else
SPAWNER_IP = "192.168.99.100"
endif
include run.makefile
.PHONY: install reload clean run run-daemon stop test tail
help:
@echo Usage: make [-e VARIABLE=VALUE] targets
@echo "variables:"
@grep -h "#\s\+\w\+ -- " $(MAKEFILE_LIST) |sed "s/#\s//"
@echo
@echo targets and corresponding dependencies:
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' -e 's/^/ /' | sed -e 's/##//'
install: ## install everware
npm install
npm install configurable-http-proxy
${PIP} install $${PIP_OPTIONS} -r requirements.txt
${PIP} install -e .
${PYTHON} setup.py css
${PYTHON} setup.py js
if [ ! -f env.sh ] ; then cp env.sh.orig env.sh ; fi
docker-build: ## build docker image
docker build --no-cache -t everware/everware:0.10.0 .
clean: ## clean user base
if [ -f ${PIDFILE} ] ; then echo "${PIDFILE} exists, cannot continute" ; exit 1; fi
rm -f jupyterhub.sqlite
run-linux: clean ## run everware server on linux
source ./env.sh && \
${EXECUTOR} -f etc/local_config.py --no-ssl 2>&1 | tee ${LOG}
test: ## run all tests
export UPLOADDIR=${UPLOADDIR}; \
py.test everware/ && \
build_tools/test_frontend.sh --Spawner.container_ip=${SPAWNER_IP}
gistup: ## install gistup
git clone https://github.com/anaderi/gistup.git src/gistup
cd src/gistup ; \
npm install -g
upload_screens: ## upload screenshots of failed tests
@which gistup > /dev/null || (echo "setup https://github.com/anaderi/gistup first" && exit 1 )
echo ${UPLOADDIR}
if [[ -d ${UPLOADDIR} && `find ${UPLOADDIR} -not -path "*/.git/*" -type f -print` != "" ]] ; then \
cd ${UPLOADDIR} ; \
if [ ! -d ".git" ] ; then \
if [[ ! -f ~/.gistup.json ]] ; then \
if [ -n "$${GIST_TOKEN}" ] ; then \
echo "{\"token\": \"$${GIST_TOKEN}\", \"protocol\": \"https\" }" > ~/.gistup.json ; \
else \
echo "no GIST_TOKEN specified. exit"; exit 1; \
fi ; \
fi ;\
OPTIONS="--no-open" ; \
if [ "${M}" != "" ] ; then OPTIONS+=" --description '${M}'" ; fi ;\
gistup $${OPTIONS} ; \
else \
git add * ;\
git commit -am "${M}" ;\
git push ;\
fi ;\
fi