forked from smarkets/marge-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (41 loc) · 1.58 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
VERSION?=$$(git rev-parse --abbrev-ref HEAD)
.PHONY: all
all: requirements_frozen.txt requirements.nix requirements_override.nix marge-bot dockerize
.PHONY: marge-bot
marge-bot:
nix-build --keep-failed --attr marge-bot default.nix
.PHONY: clean
clean:
rm -rf .cache result result-* requirements_frozen.txt
.PHONY: bump
bump: bump-requirements bump-sources
.PHONY: bump-sources
bump-sources:
nix-shell --run niv update
.PHONY: bump-requirements
bump-requirements: clean requirements_frozen.txt
requirements_frozen.txt requirements.nix requirements_override.nix: requirements.txt
pypi2nix -V 3.6 -r $^
.PHONY: dockerize
dockerize:
docker load --input $$(nix-build --attr docker-image default.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