New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
install_dev_env.sh in utils/dev – NEMO

source: utils/dev/install_dev_env.sh @ 11705

Last change on this file since 11705 was 11705, checked in by nicolasmartin, 4 years ago

Updating of the script with some improvments

  • Property svn:executable set to *
File size: 2.1 KB
RevLine 
[11705]1#!/bin/sh
[10286]2
[10334]3## Create minimal developement environment for NEMO
4###################################################
[10286]5
[11705]6## Optional arguments (developer ID, 'repo' to replicate the layout of the whole repository)
[10334]7
[11705]8dir='NEMO_dev'; repo='0'; root='/NEMO'
9ver='4.0.1'
[10334]10
[11705]11year=$( date +%Y )
[10655]12
[11705]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; }
20
[10334]21## Copy of the repository with empty root directories
[11705]22echo 'Download a void working copy of' $root 'from the repository ("svn co --depth empty")'
[10655]23svn co --depth empty http://forge.ipsl.jussieu.fr/nemo/svn/$root $dir
24echo
[10334]25
[11705]26
[10334]27## Switch to developer role if ID is provided
[11705]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
[10655]35    echo
[10286]36fi
37
[11705]38## If requested by 'repo',
39if [ "$repo" == '1' ]; then
[10655]40    echo "With 'repo' arg, create a lightweight copy of the repository"
[11705]41    echo 'for the developement of the sources defined as "externals"'
[10655]42
43    for item in utils/build/{arch,makenemo,mk} utils/tools       \
[11705]44                vendors/{AGRIF/dev,AGRIF/release-$ver,FCM,IOIPSL}  ; do
45        echo '¤' $item
46        svn up -q --parents $dir/$item
[10655]47    done
[11705]48
49    dir+=/'NEMO'
[10655]50    echo
[10334]51fi
[10286]52
[11705]53
[10286]54## Get the 1st level tree under 'branches' and 'releases'
[11705]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}
[10655]58echo
[10286]59
[11705]60
[10334]61## Download trunk and last release
[11705]62echo 'Full download of 2 main branches ("svn up"): trunk and last stable'
[10655]63echo "¤ '/NEMO/trunk'"
64svn up -q           $dir/trunk
[10286]65
[11705]66echo "¤ '/NEMO/releases/release-$ver'"
67svn up -q --parents $dir/releases/release-$ver
[10655]68
[10286]69exit 0
Note: See TracBrowser for help on using the repository browser.