forked from viv3kanand/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (38 loc) · 1.17 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
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
ifeq ($(origin .RECIPEPREFIX), undefined)
$(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
endif
.RECIPEPREFIX = >
OS := $(shell uname)
ifeq ($(OS), Darwin)
SEDI=sed -i '.bak'
else
SEDI=sed -i
endif
PYTHON ?= python
VENV = venv/bin/activate
IN_VENV=. ./$(VENV)
$(VENV):
> test -d venv || virtualenv venv --python=$(PYTHON) --prompt "(build) "
> ${IN_VENV}
> pip install pip --upgrade
> pip install requests semver
.PHONY: echo_latest_upstream
echo_latest_upstream: venv/bin/activate
> ${IN_VENV}
> $(eval TAG=$(shell . venv/bin/activate; python dockerhub_tag.py $(OWNER)/$(BASENAME) --prefix v))
> echo $(TAG)
OWNER ?= ontresearch
BASENAME ?= nanolabs-notebook
UPSTREAM ?= dev
.PHONY: epi2melabs-notebook
epi2melabs-notebook:
> echo "Using upstream ${OWNER}/${BASENAME} tag: $(UPSTREAM)"
> docker pull $(OWNER)/$(BASENAME):$(UPSTREAM)
> docker images
> docker build --rm --force-rm --build-arg BASE_CONTAINER=$(OWNER)/$(BASENAME):$(UPSTREAM) -t $(OWNER)/$@:latest -f epi2melabs.dockerfile .