-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
54 lines (41 loc) · 1.36 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
PACKAGE_NAME = driftbase
IMAGE_NAME = directivegames/drift-base
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
VERSION ?= $(shell git tag --sort=committerdate | grep -E '^[0-9]' | tail -1)
CI_COMMIT_REF_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
CI_COMMIT_SHORT_SHA ?= $(shell git rev-parse HEAD | cut -c 1-8)
BUILD_TIMESTAMP = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
BRANCH_TAG = $(subst /,_,$(BRANCH))
export FLASK_APP=${PACKAGE_NAME}.app:app
.PHONY: auth push build clean info release
build:
docker build -t ${IMAGE_NAME} . \
--build-arg VERSION='${VERSION}' \
--build-arg BUILD_TIMESTAMP='${BUILD_TIMESTAMP}' \
--build-arg COMMIT_HASH='${CI_COMMIT_SHORT_SHA}'
docker tag ${IMAGE_NAME} ${IMAGE_NAME}:${BRANCH_TAG}
push:
docker push ${IMAGE_NAME}:latest
docker push ${IMAGE_NAME}:${BRANCH_TAG}
buildami:
cd aws && packer build packer.json
launchami:
python scripts/launchami.py
git-tag:
git tag ${VERSION}
git push origin --tags -o ci.skip
run:
docker run -e DRIFT_TIER=${DRIFT_TIER} \
-e DRIFT_CONFIG_URL=${DRIFT_CONFIG_URL} \
-e DEBUG=True \
-p 10080:10080 \
-p 8080:8080 \
-p 9191:9191 \
${IMAGE_NAME}:latest
serve:
export FLASK_ENV=development && export DRIFT_OUTPUT=text && export LOGLEVEL=info && \
dconf developer -r -s
upgrade:
pipenv run flask db upgrade
black:
black -l 100 -S ${PACKAGE_NAME}