forked from datajoint/mym
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LNX-docker-compose.yml
105 lines (105 loc) · 3.83 KB
/
LNX-docker-compose.yml
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
# docker-compose -f LNX-docker-compose.yml --env-file LNX.env up --build --exit-code-from app
version: '2.4'
x-net: &net
networks:
- main
services:
db:
<<: *net
image: datajoint/mysql:${MYSQL_TAG}
environment:
- MYSQL_ROOT_PASSWORD=simple
fakeservices.datajoint.io:
<<: *net
image: datajoint/nginx:v0.1.1
environment:
- ADD_db_TYPE=DATABASE
- ADD_db_ENDPOINT=db:3306
depends_on:
db:
condition: service_healthy
app:
<<: *net
environment:
- MATLAB_LICENSE
- MATLAB_USER
- DJ_HOST=fakeservices.datajoint.io
- DJ_USER=root
- DJ_PASS=simple
- DJ_TEST_HOST=fakeservices.datajoint.io
- DJ_TEST_USER=datajoint
- DJ_TEST_PASSWORD=datajoint
image: raphaelguzman/matlab:${MATLAB_VERSION}-MIN
depends_on:
fakeservices.datajoint.io:
condition: service_healthy
user: ${MATLAB_UID}:${MATLAB_GID}
working_dir: /main
command:
- /bin/bash
- -c
- |
set -e
export ORIG_DIR=$$(pwd)
mkdir ~/Documents
cd /src
# Verify all mex have been updated
if [ "distribution/mexa64/mym.mexa64" -nt "distribution/mexmaci64/mym.mexmaci64" ]; then
echo "MACOS64 Mex binary appears outdated. Failing check..."
exit 1
fi
if [ "distribution/mexa64/mym.mexa64" -nt "distribution/mexw64/mym.mexw64" ]; then
echo "WIN64 Mex binary appears outdated. Failing check..."
exit 1
fi
# Compile mym, package into toolbox, and install
matlab -nodisplay -r "
try\
websave([tempdir 'GHToolbox.mltbx'],\
['https://github.com/datajoint/GHToolbox' \
'/releases/download/' subsref(webread(['https://api.github.com/repos' \
'/datajoint/GHToolbox' \
'/releases/latest']),\
substruct('.', 'tag_name')) \
'/GHToolbox.mltbx']);\
matlab.addons.toolbox.installToolbox([tempdir 'GHToolbox.mltbx']);\
origDir = pwd;\
cd('distribution/mexa64');\
docs = help('mym');\
cd(origDir);\
ghtb.package('mym',\
'Raphael Guzman',\
['MySQL API for MATLAB with support for BLOB objects'],\
docs,\
{'.vscode', '.git', '.gitignore', 'build', 'lib', 'maria-plugin',\
'mex_compilation', 'mysql-connector', 'notebook', 'src', 'zlib',\
'*.txt', '*.env', '*.prf', '*.md', '*.yml', 'tests', '.github',\
'distribution/mexa64/libmysqlclient.so.18.4.'},\
@() strjoin(arrayfun(@(x) num2str(x),\
cell2mat(struct2cell(mym('version'))),\
'uni', false),\
'.'),\
{'distribution/mexa64', 'distribution/mexmaci64',\
'distribution/mexw64', 'mym.m'},\
'toolboxVersionDir', 'distribution/mexa64',\
'toolboxRootDir', '.');\
matlab.addons.toolbox.installToolbox('mym.mltbx');\
cd(getenv('ORIG_DIR'));\
addpath('tests');\
res=run(Main);\
disp(res);\
if all([res.Passed]) exit, else exit(1), end;\
,\
catch ME,\
disp(getReport(ME, 'extended'));\
exit(1);\
,\
end;\
"
mac_address: $MATLAB_HOSTID
volumes:
- ./tests:/main/tests
- .:/src
networks:
main: