-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
67 lines (49 loc) · 1.61 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
.PHONY: prepare build build-generator build-test run run-generator test test-in-container clean send-master-sync send-pr-sync image-push deploy
IMAGE_NAME = quay.io/rhscl/betka
TEST_IMAGE_NAME = betka-test
DEPLOY_NAME = quay.io/rhscl/betka-deployment
UNAME=$(shell uname)
ifeq ($(UNAME),Darwin)
PODMAN := /opt/podman/bin/podman #docker
else
PODMAN := /usr/bin/podman
endif
# https://blog.153.io/2016/04/18/source-a-shell-script-in-make
-include secrets.mk
secrets.mk: secrets.env
sed 's/"//g ; s/=/:=/' < $< > $@
prepare:
mkdir -m 777 -p logs
mkdir -m 777 -p betka-generator/results
build:
$(PODMAN) build --tag ${IMAGE_NAME} -f Dockerfile .
build-generator:
docker-compose build generator
build-test: build
$(PODMAN) build --tag ${TEST_IMAGE_NAME} -f Dockerfile.tests .
run: prepare build
docker-compose --verbose up betka redis
run-betka: prepare build
./run-podman.sh
run-generator: prepare build-generator
docker-compose up generator
test:
cd tests && PYTHONPATH=$(CURDIR) pytest --color=yes --verbose --showlocals
test-in-container: build-test
$(PODMAN) run --rm --net=host -e DEPLOYMENT=test ${TEST_IMAGE_NAME}
image-push: build
$(PODMAN) push ${IMAGE_NAME}
send-master-sync:
podman exec betka python3 /tmp/betka-bot/upstream_master_sync.py
#docker-compose exec betka python3 /tmp/betka-bot/upstream_master_sync.py
clean:
find . -name '*.pyc' -delete
stop:
docker-compose down
stop-podman:
podman stop redis && podman rm redis
podman stop betka && podman rm betka
image_deploy:
$(PODMAN) build --tag=${DEPLOY_NAME} -f Dockerfile.deployment .
deploy: image_deploy
./openshift/run-deployment-in-container.sh