Ignore:
Timestamp:
2019-10-15T19:58:51+02:00 (12 months ago)
Author:
nicolasmartin
Message:

Updating of the script with some improvments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/dev/install_dev_env.sh

    r10655 r11705  
    1 #!/bin/bash 
     1#!/bin/sh 
    22 
    33## Create minimal developement environment for NEMO 
    44################################################### 
    55 
    6 ## Optional arguments 
    7 ## - $1: developer ID 
    8 ## - $2: 'repo' to replicate the layout of whole repository 
     6## Optional arguments (developer ID, 'repo' to replicate the layout of the whole repository) 
    97 
    10 dir='NEMO_dev' 
     8dir='NEMO_dev'; repo='0'; root='/NEMO' 
     9ver='4.0.1' 
    1110 
    12 if [ "$2" == 'repo' ]; then root='/'; else root='/NEMO'; fi 
     11year=$( date +%Y ) 
     12 
     13while (( $# )); do 
     14    [ "$1" == 'repo' ] && { dir='NEMO_repo' && repo='1' && root='/'; shift; } 
     15    id=$1 
     16    shift 
     17done 
     18 
     19[ -d $dir ] && { echo $dir 'already exists => QUIT'; exit 2; } 
    1320 
    1421## Copy of the repository with empty root directories 
    15 echo 'Checkout the repository from' $root 
     22echo 'Download a void working copy of' $root 'from the repository ("svn co --depth empty")' 
    1623svn co --depth empty http://forge.ipsl.jussieu.fr/nemo/svn/$root $dir 
    1724echo 
    1825 
     26 
    1927## 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 
     28if [ -n "$id" ]; then 
     29    echo 'Switch to developer role by relocating the URL scheme from HTTP to SVN+SSH' 
     30    echo '("svn sw --relocate http://... svn+ssh://...")' 
     31    ssh-copy-id -i ~/.ssh/id_rsa.pub $id@forge.ipsl.jussieu.fr 2> /dev/null 
     32    svn sw --relocate    http://forge.ipsl.jussieu.fr                        \ 
     33                      svn+ssh://$id@forge.ipsl.jussieu.fr/ipsl/forge/projets \ 
     34        $dir 
    2635    echo 
    2736fi 
    2837 
    29 if [ "$2" == 'repo' ]; then 
     38## If requested by 'repo', 
     39if [ "$repo" == '1' ]; then 
    3040    echo "With 'repo' arg, create a lightweight copy of the repository" 
    31     echo "for the developement of the sources used as 'externals'" 
     41    echo 'for the developement of the sources defined as "externals"' 
    3242 
    3343    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 
     44                vendors/{AGRIF/dev,AGRIF/release-$ver,FCM,IOIPSL}  ; do 
     45        echo '¤' $item 
     46        svn up -q --parents $dir/$item 
    3847    done 
    39     
    40     dir=$dir/'NEMO' 
     48 
     49    dir+=/'NEMO' 
    4150    echo 
    4251fi 
    4352 
     53 
    4454## 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} 
     55echo "Get empty folders under '/NEMO/branches' (\"svn up --depth empty --parents\"):" \ 
     56    {UKMO,$((year - 1)),$year} 
     57svn up -q --set-depth empty --parents $dir/branches/{UKMO,$((year - 1)),$year} 
    4758echo 
    4859 
     60 
    4961## Download trunk and last release 
    50 echo 'Full download of 2 main branches' 
     62echo 'Full download of 2 main branches ("svn up"): trunk and last stable' 
    5163echo "¤ '/NEMO/trunk'" 
    5264svn up -q           $dir/trunk 
    5365 
    54 echo "¤ latest in '/NEMO/releases'" 
    55 svn up -q --parents $dir/releases/release-4.0 
     66echo "¤ '/NEMO/releases/release-$ver'" 
     67svn up -q --parents $dir/releases/release-$ver 
    5668 
    5769exit 0 
Note: See TracChangeset for help on using the changeset viewer.