-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (35 loc) · 1.37 KB
/
Makefile
File metadata and controls
42 lines (35 loc) · 1.37 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
NAMESPACE ?= ctxsh
# VERSION := $(shell git describe --tags)
BUILD := $(shell git rev-parse --short HEAD)
CR_TOKEN ?= unset
CR_USERNAME ?= anonymous
.PHONY: all
all: core
###################################################################################################
# Login
###################################################################################################
.PHONY: login
login:
@echo $(CR_TOKEN) | docker login ghcr.io -u $(CR_USERNAME) --password-stdin
###################################################################################################
# Base
###################################################################################################
.PHONY: core
core:
@docker build \
--tag ghcr.io/$(NAMESPACE)/core:$(BUILD) \
--file core/Dockerfile \
core
.PHONY: release-core
release-core:
@docker push ghcr.io/$(NAMESPACE)/core:$(BUILD)
.PHONY: release-core-latest
release-core-latest:
@docker tag ghcr.io/$(NAMESPACE)/core:$(BUILD) ghcr.io/$(NAMESPACE)/core:latest
@docker push ghcr.io/$(NAMESPACE)/core:latest
###################################################################################################
# Clean
###################################################################################################
clean:
@docker rm $(shell docker ps -qa) || true
@docker rmi $(shell docker images -q $(NAMESPACE)/core) --force || true