-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
63 lines (51 loc) · 1.54 KB
/
Copy pathmakefile
File metadata and controls
63 lines (51 loc) · 1.54 KB
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
# -
# `VERSION` contains the current version - aka the last tagged version of the
# repository. It's stored in a file named `VERSION` and should only ever be
# updated by running `make next`.
#
# `NEXT_VERSION` contains the next version number which is generated using the
# date and contains: the two-digit year, the week number, day of week and hour.
#
# `next` updates the `VERSION` file with the `NEXT_VERSION` value which
# signifies a new version has been reached and will be released.
# `release` applies the `VERSION` to the repository by tagging the current
# repository state with the `VERSION` value and then pushes the repo to the
# git server. It's important that your `.git/config` file contains the necessary
# `push` fields under the `origin` remote (or whatever remote you use).
# -
VERSION := $(shell cat VERSION)
NEXT_VERSION := $(shell date -u +%yw%W.%w.%H)
next:
echo $(NEXT_VERSION) > VERSION
release:
# re-tag this commit
-git tag -d $(VERSION)
git tag $(VERSION)
# note: this requires that the configuration contains:
# [remote "origin"]
# url = ...
# fetch = +refs/heads/*:refs/remotes/origin/*
# push = +refs/heads/*
# push = +refs/tags/*
# in order to force tags to push alongside everything else.
git push
# -
# Local
# -
-include .env
local:
sampctl package run --forceBuild --build dev
# -
# Docker
# -
build:
docker build \
--no-cache \
--tag southclaws/tw-gamemode:$(VERSION) \
.
push:
docker push \
southclaws/tw-gamemode:$(VERSION)
run:
docker run \
southclaws/tw-gamemode:$(VERSION)