-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (56 loc) · 1.95 KB
/
Makefile
File metadata and controls
64 lines (56 loc) · 1.95 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
64
# Function to get the effective branch (default branch if current is a tag)
define get_effective_branch
$(if $(shell echo $(1) | grep -E '^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$$'),"main",$(1))
endef
VCS_REF = $(shell git rev-parse --short HEAD)
VERSION = v$(shell git describe --always --match "v*" | sed 's/^v//')
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
EFFECTIVE_BRANCH = $(call get_effective_branch,$(BRANCH))
LATEST_TAG = ghcr.io/teamwork/mcp:latest
LATEST_INTERNAL_TAG = 343218184206.dkr.ecr.us-east-1.amazonaws.com/teamwork/mcp:$(subst /,,${EFFECTIVE_BRANCH})-latest
TAG = ghcr.io/teamwork/mcp:$(VERSION)
INTERNAL_TAG = 343218184206.dkr.ecr.us-east-1.amazonaws.com/teamwork/mcp:$(VERSION)
.PHONY: build build-stdio push push-stdio install
default: build
build:
docker buildx build \
--build-arg BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg BUILD_VCS_REF=$(VCS_REF) \
--build-arg BUILD_VERSION=$(VERSION) \
--load \
--progress=plain \
--target runner \
.
build-stdio:
docker buildx build \
--build-arg BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg BUILD_VCS_REF=$(VCS_REF) \
--build-arg BUILD_VERSION=$(VERSION) \
--load \
--progress=plain \
.
push:
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg BUILD_VCS_REF=$(VCS_REF) \
--build-arg BUILD_VERSION=$(VERSION) \
-t $(INTERNAL_TAG) \
-t $(LATEST_INTERNAL_TAG) \
--push \
--progress=plain \
--target runner \
.
push-stdio:
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg BUILD_VCS_REF=$(VCS_REF) \
--build-arg BUILD_VERSION=$(VERSION) \
-t $(TAG) \
-t $(LATEST_TAG) \
--push \
--progress=plain \
.
install:
@echo "No installation required"