1 | #!/bin/bash |
---|
2 | |
---|
3 | ## Create minimal developement environment for NEMO |
---|
4 | ################################################### |
---|
5 | |
---|
6 | ## Optional arguments |
---|
7 | ## - $1: developer ID |
---|
8 | ## - $2: 'repo' to replicate the layout of whole repository |
---|
9 | |
---|
10 | dir='NEMO_dev' |
---|
11 | |
---|
12 | if [ "$2" == 'repo' ]; then root='/'; else root='/NEMO'; fi |
---|
13 | |
---|
14 | ## Copy of the repository with empty root directories |
---|
15 | echo 'Checkout the repository from' $root |
---|
16 | svn co --depth empty http://forge.ipsl.jussieu.fr/nemo/svn/$root $dir |
---|
17 | echo |
---|
18 | |
---|
19 | ## Switch to developer role if ID is provided |
---|
20 | if [ -n "$1" ]; then |
---|
21 | echo 'Switch from user to developer role (http:// => svn+ssh://)' |
---|
22 | ssh-copy-id -i ~/.ssh/id_rsa.pub $1@forge.ipsl.jussieu.fr 2> /dev/null |
---|
23 | svn sw --relocate http://forge.ipsl.jussieu.fr \ |
---|
24 | svn+ssh://$1@forge.ipsl.jussieu.fr/ipsl/forge/projets \ |
---|
25 | NEMO_dev |
---|
26 | echo |
---|
27 | fi |
---|
28 | |
---|
29 | if [ "$2" == 'repo' ]; then |
---|
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 | |
---|
40 | dir=$dir/'NEMO' |
---|
41 | echo |
---|
42 | fi |
---|
43 | |
---|
44 | ## Get the 1st level tree under 'branches' and 'releases' |
---|
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 |
---|
48 | |
---|
49 | ## Download trunk and last release |
---|
50 | echo 'Full download of 2 main branches' |
---|
51 | echo "¤ '/NEMO/trunk'" |
---|
52 | svn up -q $dir/trunk |
---|
53 | |
---|
54 | echo "¤ latest in '/NEMO/releases'" |
---|
55 | svn up -q --parents $dir/releases/release-4.0 |
---|
56 | |
---|
57 | exit 0 |
---|