File tree 5 files changed +43
-19
lines changed
5 files changed +43
-19
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,12 @@ for env in "${SETUPDIR}"/conda-environment*.yml ; do
29
29
~ /conda/bin/mamba env update --file " $env "
30
30
done
31
31
32
- echo " Setting default conda channel"
33
- cat > " $HOME /.condarc" << EOF
32
+ # Internal Conda proxy or repository
33
+ if [ -n " ${CONDA_PROXY_SERVER:- } " ]; then
34
+ echo " Configuring Conda proxy ${CONDA_PROXY_SERVER} "
35
+ cat > " $HOME /.condarc" << EOF
34
36
channels:
35
37
- conda-forge
36
- channel_alias: http://conda.hic-tre.dundee.ac.uk
38
+ channel_alias: ${CONDA_PROXY_SERVER}
37
39
EOF
40
+ fi
Original file line number Diff line number Diff line change @@ -40,10 +40,14 @@ if ( Test-Path -Path ${BASE_ENVIRONMENT_YML} -PathType Leaf ) {
40
40
Write-Output " $BASE_ENVIRONMENT_YML not found, skipping"
41
41
}
42
42
43
- $condarc = " C:\Users\Administrator\.condarc"
44
- New-Item $condarc
45
- Set-Content $condarc " channels:"
46
- Add-Content $condarc " - conda-forge"
47
- Add-Content $condarc " channel_alias: http://conda.hic-tre.dundee.ac.uk"
43
+ # Internal Conda proxy or repository
44
+ if ( $Env: CONDA_PROXY_SERVER ) {
45
+ Write-Output " Configuring conda proxy ${Env: CONDA_PROXY_SERVER} "
46
+ $condarc = " C:\Users\Administrator\.condarc"
47
+ New-Item $condarc
48
+ Set-Content $condarc " channels:"
49
+ Add-Content $condarc " - conda-forge"
50
+ Add-Content $condarc " channel_alias: ${Env: CONDA_PROXY_SERVER} "
51
+ }
48
52
49
53
conda deactivate
Original file line number Diff line number Diff line change @@ -25,14 +25,21 @@ $RConfig = @"
25
25
# Set the default help type
26
26
options(help_type="html")
27
27
28
- # HIC TRE R Repository
28
+ # Set timezone
29
+ Sys.setenv(TZ='Europe/London')
30
+
31
+ "@
32
+
33
+ # Internal CRAN proxy or repository
34
+ if ( $Env: CRAN_PROXY_SERVER ) {
35
+ Write-Output " Configuring CRAN proxy ${Env: CRAN_PROXY_SERVER} "
36
+ $RConfig += @"
29
37
local({r <- getOption("repos")
30
- r["CRAN"] <- "http://cran.hic-tre.dundee.ac.uk/ "
38
+ r["CRAN"] <- "${ Env: CRAN_PROXY_SERVER} "
31
39
options(repos=r)
32
40
})
33
-
34
- # Set timezone
35
- Sys.setenv(TZ='Europe/London')
36
41
"@
42
+ }
43
+
37
44
Set-Content " C:\Program Files\R\R-4.4.0\etc\Rprofile.site" $RConfig
38
45
Set-Content " C:\Users\Administrator\Documents\.Renviron" " RSTUDIO_DISABLE_SECURE_DOWNLOAD_WARNING=1"
Original file line number Diff line number Diff line change @@ -42,16 +42,20 @@ cat > "$HOME/.Rprofile" <<EOF
42
42
# Set the default help type
43
43
options(help_type="html")
44
44
45
- # HIC TRE R Repository
46
- local({r <- getOption("repos")
47
- r["CRAN"] <- "http://cran.hic-tre.dundee.ac.uk/"
48
- options(repos=r)
49
- })
50
-
51
45
# Set timezone
52
46
Sys.setenv(TZ='Europe/London')
53
47
EOF
54
48
49
+ # Internal CRAN proxy or repository
50
+ if [ -n " ${CRAN_PROXY_SERVER:- } " ]; then
51
+ echo " Configuring CRAN proxy ${CRAN_PROXY_SERVER} "
52
+ cat >> " $HOME /.Rprofile" << EOF
53
+ local({r <- getOption("repos")
54
+ r["CRAN"] <- "$CRAN_PROXY_SERVER "
55
+ options(repos=r)
56
+ })
57
+ EOF
58
+
55
59
echo " RSTUDIO_DISABLE_SECURE_DOWNLOAD_WARNING=1" >> " $HOME /.Renviron"
56
60
57
61
sudo add-apt-repository -y ppa:c2d4u.team/c2d4u4.0+
Original file line number Diff line number Diff line change 6
6
7
7
{% set env = env |default ([],true ) %}
8
8
{% set private_env = private_env |default ([],true ) %}
9
+ {# For example, to configure an internal CRAN and conda proxy/repository:
10
+ {% set private_env = [
11
+ "CONDA_PROXY_SERVER=http://conda.hic-tre.dundee.ac.uk",
12
+ "CRAN_PROXY_SERVER=http://cran.hic-tre.dundee.ac.uk/",
13
+ ] %}
14
+ #}
9
15
10
16
{% set modules = modules |default ([],true ) %}
11
17
{% set security_modules = security_modules |default ([],true ) %}
You can’t perform that action at this time.
0 commit comments