-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
116 lines (85 loc) · 2.96 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/make
# @Author: bsuttor
# @Date: 2018-06-11T16:29:42+02:00
# @Last modified by: bsuttor
# @Last modified time: 2018-06-11T16:49:39+02:00
IMAGE_NAME="docker-staging.imio.be/iasmartweb/mutual:latest"
ifeq (rsync,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "rsync"
RSYNC_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(RSYNC_ARGS):;@:)
endif
VERSION=`cat version.txt`
#BUILD_NUMBER := debug1
UID := $(shell id -u)
PROJECTID := $(shell basename "${PWD}")
RSYNC_ARGS := $(if $(RSYNC_ARGS),$(RSYNC_ARGS),"a")
all: run
buildout.cfg:
ln -fs dev.cfg buildout.cfg
#ln -fs prod.cfg buildout.cfg
bin/pip:
if [ -f /usr/bin/virtualenv-2.7 ] ; then virtualenv-2.7 .;else virtualenv -p python2.7 .;fi
bin/buildout: buildout.cfg
./bin/pip install -r requirements.txt
dev: buildout.cfg bin/pip bin/buildout
./bin/buildout -Nt 30
.PHONY: robot-server
robot-server:
bin/robot-server -v cpskin.policy.testing.CPSKIN_POLICY_ROBOT_TESTING
.PHONY: cleanall
cleanall:
rm -fr develop-eggs downloads eggs parts .installed.cfg lib include bin .mr.developer.cfg .env traefik.toml local/ var/instance/minisites/* __pycache__
docker-compose down
var/instance/minisites:
mkdir -p var/instance/minisites
.env:
echo uid=${UID} > .env
python scripts/config.py --serverinfos
env: .env
### DOCKER ###
.PHONY: run
run: build
$(MAKE) up
docker-image:
docker build --pull -t iasmartweb/mutual:latest .
var/blobstorage:
mkdir -p var/blobstorage
var/filestorage:
mkdir -p var/filestorage
build:
# rm -rf local/ bin/
docker-compose build --pull zeo # <--no-cache
make buildout
buildout:
# docker-compose run --rm zeo bin/develop checkout .
docker-compose run --rm instance bash -c "virtualenv . && bin/pip install -I -r requirements.txt && bin/buildout -c docker-dev.cfg"
test-image:
echo "to do"
upgrade: .env var/instance/minisites
docker-compose run --rm instance bin/upgrade-portals
docker-permissions:
docker-compose run --rm -u root zeo chown -R imio:imio /home/imio/imio-website/var
local-permissions:
sudo chown -R $(USER):$(USER) var
up: minisites var/instance/minisites docker-permissions
# docker-compose run --rm --service-ports instance
docker-compose up
bash: .env var/instance/minisites
docker-compose run --rm -p 8081:8081 --name instance instance bash
rsync: bin/pip .env var/blobstorage var/filestorage
./bin/python scripts/config.py --rsync $(RSYNC_ARGS)
minisites: .env var/instance/minisites bin/python
./bin/python scripts/config.py --minisitesfiles
eggs: ## Copy eggs from docker image to speed up docker build
-docker run --entrypoint='' $(IMAGE_NAME) tar -c -C /home/imio/imio-website eggs | tar x
##-docker run --entrypoint='' $(IMAGE_NAME) tar -c -C /home/imio/.buildout eggs | tar x
mkdir -p eggs
### Locust testing ###
p3:
virtualenv -p python3 p3
p3/bin/pytest: p3
p3/bin/pip install -r tests/requirements.txt
test-starting: p3/bin/pytest
./p3/bin/pytest -s tests