forked from smarkets/marge-bot
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
39 lines (30 loc) · 1006 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
VERSION?=$$(git rev-parse --abbrev-ref HEAD)
.PHONY: all
all: dockerize
.PHONY: bump
bump: bump-requirements
poetry.lock:
poetry install
.PHONY: bump-poetry-lock
bump-poetry-lock:
poetry update
.PHONY: bump-requirements
bump-requirements: bump-poetry-lock
.PHONY: dockerize
dockerize:
docker build --tag hiboxsystems/marge-bot:$$(cat version) .
.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 hiboxsystems/marge-bot:$$(cat version) hiboxsystems/marge-bot:latest; \
docker push hiboxsystems/marge-bot:latest;
if [ "$(VERSION)" = "$$(cat version)" ]; then \
docker tag hiboxsystems/marge-bot:$$(cat version) hiboxsystems/marge-bot:$(VERSION); \
docker tag hiboxsystems/marge-bot:$$(cat version) hiboxsystems/marge-bot:stable; \
docker push hiboxsystems/marge-bot:$(VERSION); \
docker push hiboxsystems/marge-bot:stable; \
fi