-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathmakefile
85 lines (69 loc) · 3.29 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
IMG_NAME=ubuntu-1804_jmodelica_trunk
DOCKER_REPONAME=lbnlblum
COMMAND_RUN=docker run \
--name jmodelica \
--detach=false \
-e DISPLAY=${DISPLAY} \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--rm \
-v `pwd`/shared:/mnt/shared \
${DOCKER_REPONAME}/${IMG_NAME} /bin/bash -c
COMMAND_START=docker run \
--name jmodelica \
--detach=false \
--rm \
--interactive \
-t \
-v `pwd`/shared:/mnt/shared \
${DOCKER_REPONAME}/${IMG_NAME} \
/bin/bash -c -i
print_latest_versions_from_svn:
svn log -l 1 https://svn.jmodelica.org/trunk
svn log -l 1 https://svn.jmodelica.org/assimulo/trunk
build:
docker build --no-cache --rm -t ${DOCKER_REPONAME}/${IMG_NAME} .
verify: verify-buildings-master verify-buildings-spawn verify-boptest
push:
docker push ${DOCKER_REPONAME}/${IMG_NAME}
verify-buildings-master:
$(eval TMPDIR := $(shell mktemp -d -t tmp-ubuntu-jmodelica-verification-buildings-master-XXXX))
@echo "Running Modelica Buildings Library verification in $(TMPDIR)"
cd ${TMPDIR} && git clone --depth 1 --recurse-submodules --quiet https://github.com/lbl-srg/BuildingsPy.git
cd ${TMPDIR} && git clone --depth 1 --quiet https://github.com/lbl-srg/modelica-buildings.git
$(eval PYTHONPATH := ${TMPDIR}/BuildingsPy:${TMPDIR}/modelica-buildings/Buildings/Resources/Python-Sources)
cd ${TMPDIR}/modelica-buildings/Buildings && ../bin/runUnitTests.py --skip-verification -t jmodelica -n 44
rm -rf ${TMPDIR}
verify-buildings-spawn:
$(eval TMPDIR := $(shell mktemp -d -t tmp-ubuntu-jmodelica-verification-buildings-spawn-XXXX))
@echo "Running Spawn verification in $(TMPDIR)"
cd ${TMPDIR} && git clone --depth 1 --recurse-submodules --quiet https://github.com/lbl-srg/BuildingsPy.git
cd ${TMPDIR} && git clone --depth 1 --quiet -b issue1129_energyPlus_zone https://github.com/lbl-srg/modelica-buildings.git
$(eval PYTHONPATH := ${TMPDIR}/BuildingsPy:${TMPDIR}/modelica-buildings/Buildings/Resources/Python-Sources)
cd ${TMPDIR}/modelica-buildings/Buildings && ../bin/runUnitTests.py --skip-verification -t jmodelica -n 44 -s Buildings.Experimental.EnergyPlus
rm -rf ${TMPDIR}
verify-boptest:
$(eval PWD := $(shell pwd))
$(eval TMPDIR := $(shell mktemp -d -t tmp-ubuntu-jmodelica-verification-boptest-XXXX))
@echo "Running BOPTEST verification in $(TMPDIR)"
cd ${TMPDIR} && git clone --depth 1 --quiet https://github.com/ibpsa/project1-boptest.git
$(eval NEW_PYPA := ${TMPDIR}/project1-boptest)
@echo "Silently try to remove the old image"
cd ${TMPDIR}/project1-boptest/testing && make -s remove_jm_image 2> /dev/null | true
@echo "Running BOPTEST CI tests, stdout and stderr redirected to verify-boptest.log"
cd ${TMPDIR}/project1-boptest/testing && export PYTHONPATH=${NEW_PYPA} && make -s test_all > ${PWD}/verify-boptest.log 2>&1
@echo "Silently try to remove the BOPTEST images"
cd ${TMPDIR}/project1-boptest/testing && make -s remove_jm_image 2> /dev/null | true
rm -rf ${TMPDIR}
remove-image:
docker rmi ${DOCKER_REPONAME}/${IMG_NAME}
start_bash:
$(COMMAND_START) \
"export MODELICAPATH=/usr/local/JModelica/ThirdParty/MSL:. && \
cd /mnt/shared && bash"
start_ipython:
$(COMMAND_START) \
"export MODELICAPATH=/usr/local/JModelica/ThirdParty/MSL:. && \
cd /mnt/shared && \
/usr/local/JModelica/bin/jm_ipython.sh"
clean_output:
rm `pwd`/shared/{*.txt,*.fmu}