-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (28 loc) · 1.11 KB
/
Makefile
File metadata and controls
40 lines (28 loc) · 1.11 KB
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
.PHONY: build shell test default
# Name of this service/application
export SERVICE_NAME := pynesis
# Configure shell to use bash by default
SHELL := $(shell which bash)
# Get docker path or an empty string
DOCKER := $(shell command -v docker)
# Get the main unix group for the user running make (to be used later)
export GID := $(shell id -g)
# Get the unix user id for the user running make (to be used later)
export UID := $(shell id -u)
# Home directory within the image, for .ssh and similar volumes
SERVICE_HOME := "/home/$(SERVICE_NAME)"
# Bash history file for container shell
HISTORY_FILE := ~/.bash_history.$(SERVICE_NAME)
default: build
deps:
ifndef DOCKER
@echo "Docker is not available. Please install docker"
@exit 1
endif
build:
$(DOCKER) build --build-arg uid=$(UID) --build-arg gid=$(GID) -t $(SERVICE_NAME):latest .
shell: build
$(DOCKER) run -v $$PWD:/code -v pynesis-tox:/code/.tox --rm -it $(SERVICE_NAME):latest /bin/bash
test: build
# Required to clean ephemeral storage after running tests (even if they fail)
$(DOCKER) run -v $$PWD:/code -v pynesis-tox:/code/.tox --rm $(SERVICE_NAME):latest tox