forked from t0ny-peng/marge-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (34 loc) · 1.38 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
VERSION?=$$(git rev-parse --abbrev-ref HEAD)
requirements_frozen.txt requirements.nix requirements_override.nix: requirements.txt
pypi2nix -V 3.6 -r $^
.PHONY: all
all: requirements_frozen.txt requirements.nix requirements_override.nix default.nix
nix-build -K .
.PHONY: clean
clean:
rm -rf .cache result requirements_frozen.txt
.PHONY: bump-requirements
bump-requirements: clean requirements_frozen.txt
.PHONY: dockerize
dockerize: dockerize.nix
docker load --input $$(nix-build dockerize.nix)
.PHONY: docker-push
docker-push:
if [ -n "$$DOCKER_USERNAME" -a -n "$$DOCKER_PASSWORD" ]; then \
docker login -u "$${DOCKER_USERNAME}" -p "$${DOCKER_PASSWORD}"; \
else \
docker login; \
fi
docker tag smarkets/marge-bot:$$(cat version) smarkets/marge-bot:$(VERSION)
if [ "$(VERSION)" = "$$(cat version)" ]; then \
docker tag smarkets/marge-bot:$$(cat version) smarkets/marge-bot:latest; \
docker tag smarkets/marge-bot:$$(cat version) smarkets/marge-bot:stable; \
docker push smarkets/marge-bot:stable; \
docker push smarkets/marge-bot:latest; \
fi
docker push smarkets/marge-bot:$(VERSION)
# for backwards compatibility push to previous location
docker tag smarkets/marge-bot:$$(cat version) smarketshq/marge-bot:latest
docker tag smarkets/marge-bot:$$(cat version) smarketshq/marge-bot:$(VERSION)
docker push smarketshq/marge-bot:$(VERSION)
docker push smarketshq/marge-bot:latest