-
Notifications
You must be signed in to change notification settings - Fork 495
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (61 loc) · 2.42 KB
/
Copy pathMakefile
File metadata and controls
81 lines (61 loc) · 2.42 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
IMAGE:=sameersbn/redmine
CERTS_DIR=certs
CERT_FILES=$(CERTS_DIR)/redmine.crt $(CERTS_DIR)/dhparam.pem
.PHONY: test-release test-compose-matrix generate-certs clean
# Test stack uses throwaway named volumes (see docker-compose.testvols.yml) so
# the release smoke test doesn't need sudo and always starts clean.
COMPOSE_TEST := docker compose -f docker-compose.yml -f test/docker-compose.testvols.yml -f test/docker-compose.postgresvols.yml
all: build
help:
@echo ""
@echo "-- Help Menu"
@echo ""
@echo " 1. make build - build the redmine image"
@echo " 2. make quickstart - start redmine"
@echo " 3. make stop - stop redmine"
@echo " 4. make logs - view logs"
@echo " 5. make purge - stop and remove the container"
build:
@docker build --tag=$(IMAGE) .
test-release: generate-certs
@echo "Clean old run (throwaway volumes, no sudo)"
$(COMPOSE_TEST) down -v --remove-orphans
$(COMPOSE_TEST) build
$(COMPOSE_TEST) up
# Smoke-test each locally-runnable compose file with throwaway volumes.
# Recommended for major-version releases. Pass FILES="..." to override the set.
test-compose-matrix: generate-certs
./test/smoke-compose.sh $(FILES)
generate-certs: $(CERT_FILES)
$(CERTS_DIR):
mkdir -p $(CERTS_DIR)
$(CERTS_DIR)/redmine.key: | $(CERTS_DIR)
openssl genrsa -out $(CERTS_DIR)/redmine.key 2048
$(CERTS_DIR)/redmine.csr: $(CERTS_DIR)/redmine.key
openssl req -new -key $(CERTS_DIR)/redmine.key -out $(CERTS_DIR)/redmine.csr
$(CERTS_DIR)/redmine.crt: $(CERTS_DIR)/redmine.csr $(CERTS_DIR)/redmine.key
openssl x509 -req -days 365 -in $(CERTS_DIR)/redmine.csr -signkey $(CERTS_DIR)/redmine.key -out $(CERTS_DIR)/redmine.crt
$(CERTS_DIR)/dhparam.pem: | $(CERTS_DIR)
openssl dhparam -out $(CERTS_DIR)/dhparam.pem 2048
clean:
rm -rf $(CERTS_DIR)
release:
./make_release.sh
@echo "Open https://github.com/sameersbn/docker-redmine/releases and Draft new release"
quickstart:
@echo "Starting redmine..."
@docker run --name=redmine-demo -d -p 10080:80 \
-v /var/run/docker.sock:/run/docker.sock \
-v $(shell which docker):/bin/docker \
$(IMAGE) >/dev/null
@echo "Please be patient. This could take a while..."
@echo "Redmine will be available at http://localhost:10080"
@echo "Type 'make logs' for the logs"
stop:
@echo "Stopping redmine..."
@docker stop redmine-demo >/dev/null
purge: stop
@echo "Removing stopped container..."
@docker rm redmine-demo >/dev/null
logs:
@docker logs -f redmine-demo