[10286] | 1 | #!/bin/bash |
---|
| 2 | |
---|
[10334] | 3 | ## Create minimal developement environment for NEMO |
---|
| 4 | ################################################### |
---|
[10286] | 5 | |
---|
[10334] | 6 | ## Optional arguments |
---|
| 7 | ## - $1: developer ID |
---|
| 8 | ## - $2: 'repo' to replicate the layout of whole repository |
---|
| 9 | |
---|
| 10 | dir='NEMO_dev' |
---|
| 11 | |
---|
[10655] | 12 | if [ "$2" == 'repo' ]; then root='/'; else root='/NEMO'; fi |
---|
| 13 | |
---|
[10334] | 14 | ## Copy of the repository with empty root directories |
---|
[10655] | 15 | echo 'Checkout the repository from' $root |
---|
| 16 | svn co --depth empty http://forge.ipsl.jussieu.fr/nemo/svn/$root $dir |
---|
| 17 | echo |
---|
[10334] | 18 | |
---|
| 19 | ## Switch to developer role if ID is provided |
---|
[10286] | 20 | if [ -n "$1" ]; then |
---|
[10655] | 21 | echo 'Switch from user to developer role (http:// => svn+ssh://)' |
---|
[10334] | 22 | ssh-copy-id -i ~/.ssh/id_rsa.pub $1@forge.ipsl.jussieu.fr 2> /dev/null |
---|
[10655] | 23 | svn sw --relocate http://forge.ipsl.jussieu.fr \ |
---|
| 24 | svn+ssh://$1@forge.ipsl.jussieu.fr/ipsl/forge/projets \ |
---|
[10334] | 25 | NEMO_dev |
---|
[10655] | 26 | echo |
---|
[10286] | 27 | fi |
---|
| 28 | |
---|
[10334] | 29 | if [ "$2" == 'repo' ]; then |
---|
[10655] | 30 | echo "With 'repo' arg, create a lightweight copy of the repository" |
---|
| 31 | echo "for the developement of the sources used as 'externals'" |
---|
| 32 | |
---|
| 33 | for item in utils/build/{arch,makenemo,mk} utils/tools \ |
---|
| 34 | vendors/{AGRIF/dev,AGRIF/release-4.0,FCM,IOIPSL} ; do |
---|
| 35 | # vendors/{AGRIF/dev,AGRIF/stable,FCM,IOIPSL} ; do |
---|
| 36 | echo '¤' $item |
---|
| 37 | svn up -q --parents $dir/$item |
---|
| 38 | done |
---|
| 39 | |
---|
[10334] | 40 | dir=$dir/'NEMO' |
---|
[10655] | 41 | echo |
---|
[10334] | 42 | fi |
---|
[10286] | 43 | |
---|
| 44 | ## Get the 1st level tree under 'branches' and 'releases' |
---|
[10655] | 45 | echo "Get empty development folders under '/NEMO/branches':" {UKMO,2018,2019} |
---|
| 46 | svn up -q --set-depth empty --parents $dir/branches/{UKMO,2018,2019} |
---|
| 47 | echo |
---|
[10286] | 48 | |
---|
[10334] | 49 | ## Download trunk and last release |
---|
[10655] | 50 | echo 'Full download of 2 main branches' |
---|
| 51 | echo "¤ '/NEMO/trunk'" |
---|
| 52 | svn up -q $dir/trunk |
---|
[10286] | 53 | |
---|
[10655] | 54 | echo "¤ latest in '/NEMO/releases'" |
---|
| 55 | svn up -q --parents $dir/releases/release-4.0 |
---|
| 56 | |
---|
[10286] | 57 | exit 0 |
---|