forked from containerbuildsystem/cachito
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (32 loc) · 1.52 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
CACHITO_COMPOSE_ENGINE ?= docker-compose
ifeq ($(CACHITO_COMPOSE_ENGINE), docker-compose)
DOWN_OPTS=-v
endif
all: run
clean:
$(CACHITO_COMPOSE_ENGINE) down $(DOWN_OPTS)
rm -rf venv && rm -rf *.egg-info && rm -rf dist && rm -rf *.log* && rm -rf .tox && rm -rf tmp
venv:
virtualenv --python=python3 venv && venv/bin/pip install -r requirements.txt -r requirements-web.txt tox && venv/bin/python setup.py develop
run:
ifeq ($(CACHITO_COMPOSE_ENGINE), podman-compose)
# SELinux should not be enabled
@test "$(shell getenforce)" = "Enforcing" && { echo "SELinux is enforcing. Disable it before running with podman-compose (RE-ENABLE IT AFTERWARDS)"; exit 1; } || true
# Create the other directories for podman-compose compatibility
# See https://github.com/containers/podman-compose/issues/185
mkdir -p ./tmp/athens-storage
mkdir -p ./tmp/request-logs-volume
endif
# Manually create this directory to allow the integration tests suite to create a local git
# repository in that directory. If this is not done here, docker will create the directory
# as root and python will not be able to create the local repository there.
mkdir -p ./tmp/cachito-archives
# Manually create the Nexus volume directory and allow others to write in it. The Nexus
# container runs as the "nexus" user, neither docker nor podman are able to change the
# owner of a host directory.
mkdir -p ./tmp/nexus-volume
setfacl -d -m other::rwx ./tmp/nexus-volume
setfacl -m other::rwx ./tmp/nexus-volume
$(CACHITO_COMPOSE_ENGINE) up
test:
PATH="$PWD/venv/bin:$PATH" tox