I'm currently struggling with running a .sh
script I'm trying to trigger from Jenkins.
Within the Jenkins "execute shell" section, I'm connecting to a remote server (The Jenkins agent does not have right OS to build what I need.), using:
cp -r . /to/shared/drive/to/have/access/on/remote
ssh -t -t username@servername << EOF
cd /to/shared/drive/to/have/access/on/remote
source build.sh dev
exit
EOF
Inside build.sh
, I'm exporting R_LIBS
to build a package for different R versions.
...
for path in "${!rVersionPaths[@]}"; do
export R_LIBS="${path}"
Rscript -e 'install.packages(c("someDependency", "someOtherDependency"), repos="http://cran.r-project.org");'
...
Setting R_LIBS
should functions here like setting lib
within install.packages(...)
. For some reason the R_LIBS
export
doesn't get picked up. Also setting other env variables like http_proxy
are ignored. This causes any requests outside the network to fail.
Is there any particular way of achieving this?