-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (62 loc) · 2.15 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
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
82
#
# Copyright (C) 2021 Storm Project
#
# storm-bundle is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
#
.PHONY: configure* start help logs
#
# Definitions
#
# Docker compose which the services
# is defined.
COMPOSE_FILE = docker-compose.yml
# Utility
RUN_IN_CONTAINER = docker-compose -f $(COMPOSE_FILE) exec $(CONTAINER_BASE) $(COMMAND)
#
# Start the Storm bundle
#
start: ## Start the Storm Bundle (default)
@echo "Building services"
docker-compose -f docker-compose.yml up -d
#
# Base configuration commands
#
# Configure the Storm Portal
configure_portal:
@echo "Configuring the Storm Portal..."
@echo "Initializing the database..."
$(RUN_IN_CONTAINER) portal-api invenio db init create
@echo "Defining the default files location"
$(RUN_IN_CONTAINER) portal-api invenio files location create --default default-location /opt/invenio/var/instance/data
@echo "Creating the superuser"
$(RUN_IN_CONTAINER) portal-api invenio roles create admin
$(RUN_IN_CONTAINER) portal-api invenio access allow superuser-access role admin
@echo "Indexing!"
$(RUN_IN_CONTAINER) portal-api invenio index init
$(RUN_IN_CONTAINER) portal-api invenio rdm-records fixtures
# Configure the Storm WS
configure_stormws:
@echo "Configuring the Storm WS..."
@echo "Initializing the database..."
$(RUN_IN_CONTAINER) stormws-api invenio db init create
@echo "Defining the default files location"
$(RUN_IN_CONTAINER) stormws-api invenio files location create --default default-location /opt/invenio/var/instance/data
@echo "Indexing!"
$(RUN_IN_CONTAINER) stormws-api invenio index init
#
# Configurations
#
configure: configure_stormws configure_portal ## Configure the Storm services.
@echo "All services has been configured"
#
# Logs
#
logs: ## Show the bundle service logs
@echo "Getting the bundle logs"
docker-compose logs -f --tail 100
#
# Documentation function (thanks for https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html)
#
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'