Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidNew-NOAA committed Nov 3, 2024
1 parent 04aac53 commit 43b291b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 27 deletions.
17 changes: 4 additions & 13 deletions ush/submodules/add_submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,10 @@ my_dir="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"

gdasdir=${1:-${my_dir}/../../}

repos="
oops
vader
saber
ioda
ufo
fv3-jedi
soca
iodaconv
"
repos=($(git submodule --quiet foreach 'echo $name'))

for r in $repos; do
echo "Adding ${gdasdir}/sorc/${r}"
cd ${gdasdir}/sorc
cd ${gdasdir}
for r in ${repos[@]}; do
echo "Adding ${gdasdir}/${r}"
git add ${r}
done
31 changes: 17 additions & 14 deletions ush/submodules/update_develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@
# update_develop.sh
# update specified repositories to most recent develop hash

repos="
oops
vader
saber
ioda
ufo
fv3-jedi
soca
iodaconv
"
# submodules not to be updated
excluded_repos=()
#excluded_repos=("parm/jcb-gdas" "sorc/fv3-jedi") # example

# get list of all submodules
repos=$(git submodule --quiet foreach 'echo $name')

my_dir="$( cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd )"

gdasdir=${1:-${my_dir}/../../}

for r in $repos; do
echo "Updating ${gdasdir}/sorc/${r}"
cd ${gdasdir}/sorc
git submodule update --remote --merge ${r}
cd ${gdasdir}

# clone new submodules that exist for this branch (don't update existing ones yet)
git submodule update --init --no-fetch

# update submodules to develop
for r in "${repos[@]}"; do
if [[ ! "${excluded_repos[@]}" =~ "${r}" ]]; then
echo "Updating ${gdasdir}/${r}"
git submodule update --remote --merge ${r}
fi
done

0 comments on commit 43b291b

Please sign in to comment.