File tree Expand file tree Collapse file tree 3 files changed +46
-13
lines changed
Expand file tree Collapse file tree 3 files changed +46
-13
lines changed Original file line number Diff line number Diff line change 1818
1919# install core system dependencies
2020if [[ $os = Linux ]]; then
21- downloadAndRun https://ssd.mathworks.com/supportfiles/ci/matlab-deps/v0/install.sh ${PARAM_RELEASE}
21+ downloadAndRun https://ssd.mathworks.com/supportfiles/ci/matlab-deps/v0/install.sh " ${PARAM_RELEASE} "
2222fi
2323
2424# install ephemeral version of MATLAB
25- downloadAndRun https://ssd.mathworks.com/supportfiles/ci/ephemeral-matlab/v0/ci-install.sh --release ${PARAM_RELEASE}
25+ if [ -n " ${MATHWORKS_ACCOUNT} " ] && [ -n " ${MATHWORKS_TOKEN} " ]; then
26+ activationFlag=" --skip-activation"
27+ fi
28+
29+ downloadAndRun https://ssd.mathworks.com/supportfiles/ci/ephemeral-matlab/v0/ci-install.sh --release " ${PARAM_RELEASE} " $activationFlag
2630
27- # add MATLAB to path
2831tmpdir=$( dirname " $( mktemp -u) " )
2932rootdir=$( cat " $tmpdir /ephemeral_matlab_root" )
33+
34+ # install matlab-batch
3035if [[ $os = CYGWIN* || $os = MINGW* || $os = MSYS* ]]; then
36+ batchInstallDir=' /c/Program Files/matlab-batch'
3137 rootdir=$( cygpath " $rootdir " )
38+ else
39+ batchInstallDir=' /opt/matlab-batch'
3240fi
33- echo ' export PATH="' $rootdir ' /bin:$PATH"' >> $BASH_ENV
41+
42+ downloadAndRun https://ssd.mathworks.com/supportfiles/ci/matlab-batch/v0/install.sh " $batchInstallDir "
43+
44+ # add MATLAB and matlab-batch to path
45+ echo ' export PATH="' $rootdir ' /bin:' $batchInstallDir ' :$PATH"' >> $BASH_ENV
Original file line number Diff line number Diff line change 1+ downloadAndRun () {
2+ url=$1
3+ shift
4+ if [[ -x $( command -v sudo) ]]; then
5+ curl -sfL $url | sudo -E bash -s -- " $@ "
6+ else
7+ curl -sfL $url | bash -s -- " $@ "
8+ fi
9+ }
10+
111tmpdir=$( mktemp -d 2> /dev/null || mktemp -d -t ' run-command' )
212
3- # download run command shell scripts
4- curl -sfLo " ${tmpdir} /run-matlab-command.zip" https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v0/run-matlab-command.zip
5- unzip -qod " ${tmpdir} /bin" " ${tmpdir} /run-matlab-command.zip"
13+ # install run-matlab-command
14+ downloadAndRun https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v1/install.sh " ${tmpdir} /bin"
615
716# form OS appropriate paths for MATLAB
817os=$( uname)
918workdir=$( pwd)
1019scriptdir=$tmpdir
20+ binext=" "
1121if [[ $os = CYGWIN* || $os = MINGW* || $os = MSYS* ]]; then
1222 workdir=$( cygpath -w " $workdir " )
1323 scriptdir=$( cygpath -w " $scriptdir " )
24+ binext=" .exe"
1425fi
1526
1627# create script to execute
@@ -22,4 +33,4 @@ ${PARAM_COMMAND}
2233EOF
2334
2435# run MATLAB command
25- " ${tmpdir} /bin/run_matlab_command.sh " " cd('${scriptdir// \' / \'\' } '); $script "
36+ " ${tmpdir} /bin/run-matlab-command $binext " " cd('${scriptdir// \' / \'\' } ');$script "
Original file line number Diff line number Diff line change 1+ downloadAndRun () {
2+ url=$1
3+ shift
4+ if [[ -x $( command -v sudo) ]]; then
5+ curl -sfL $url | sudo -E bash -s -- " $@ "
6+ else
7+ curl -sfL $url | bash -s -- " $@ "
8+ fi
9+ }
10+
111tmpdir=$( mktemp -d 2> /dev/null || mktemp -d -t ' run-tests' )
212
3- # download run command shell scripts
4- curl -sfLo " ${tmpdir} /bin.zip" https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v0/run-matlab-command.zip
5- unzip -qod " ${tmpdir} /bin" " ${tmpdir} /bin.zip"
13+ # install run-matlab-command
14+ downloadAndRun https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v1/install.sh " ${tmpdir} /bin"
615
716# download script generator
817curl -sfLo " ${tmpdir} /scriptgen.zip" https://ssd.mathworks.com/supportfiles/ci/matlab-script-generator/v0/matlab-script-generator.zip
@@ -11,12 +20,13 @@ unzip -qod "${tmpdir}/scriptgen" "${tmpdir}/scriptgen.zip"
1120# form OS appropriate paths for MATLAB
1221os=$( uname)
1322gendir=$tmpdir
23+ binext=" "
1424if [[ $os = CYGWIN* || $os = MINGW* || $os = MSYS* ]]; then
1525 gendir=$( cygpath -w " $gendir " )
26+ binext=" .exe"
1627fi
1728
18- # generate and run MATLAB test script
19- " ${tmpdir} /bin/run_matlab_command.sh" " \
29+ " ${tmpdir} /bin/run-matlab-command$binext " " \
2030 addpath('${gendir} /scriptgen');\
2131 testScript = genscript('Test',\
2232 'JUnitTestResults','${PARAM_TEST_RESULTS_JUNIT} ',\
You can’t perform that action at this time.
0 commit comments