forked from ecmwf/magics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (28 loc) · 926 Bytes
/
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
# test
TEST_CMD := python -m Magics selfcheck
# load variables from ./hooks/env
DATE := ${shell . ./hooks/env && echo $$DATE}
SOURCE_URL := ${shell . ./hooks/env && echo $$SOURCE_URL}
SOURCE_BRANCH := ${shell . ./hooks/env && echo $$SOURCE_BRANCH}
SOURCE_COMMIT := ${shell . ./hooks/env && echo $$SOURCE_COMMIT}
SOURCE_TAG := ${shell . ./hooks/env && echo $$SOURCE_TAG}
DOCKER_TAG := ${shell . ./hooks/env && echo $$DOCKER_TAG}
IMAGE_NAME := ${shell . ./hooks/env && echo $$IMAGE_NAME}
all: build
.PHONY: build run run-interactive test login login-user-pass push clean
build:
./hooks/build
run:
@docker run --rm -i -t ${IMAGE_NAME}
run-interactive:
@docker run --rm -i -t ${IMAGE_NAME} sh
test:
@docker run --rm -i -t ${IMAGE_NAME} ${TEST_CMD}
login:
@docker login
login-user-pass:
@docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}
push: login
@docker push ${DOCKER_REPO}
clean:
@docker rmi ${DOCKER_REPO}