coreos/scripts/coreos-update-submodule

38 lines
944 B
Bash
Executable File

#!/usr/bin/env bash
set -e
echo "Updating layers"
# First we go to the root git repository. This will fail if we are not inside
# a repository
gitdir=$(git rev-parse --show-toplevel)
echo "Root Git directory found at $gitdir"
cd $gitdir
# Ensure we are inside the CoreOS repository
if ! [ -f "coreos-init-build-env" ]; then
echo "We are not inside the CoreOS repository"
exit 1
fi
echo "This script will update each submodule by pulling from the upstream url"
echo "Then the internal mirror on bitbucket.gad.local will be updated"
printf 'Do you want to proceed (y/n)? '
read answer
if ! [ "$answer" != "${answer#[Yy]}" ] ; then
exit 1
fi
echo "Update all submodule to latest commit, using the tracking branch..."
git submodule foreach "_coreos-update-submodule-internal"
echo "All submodule are updated, internal mirror are up to date"
echo "You can now use git add and git commit to push changes to CoreOS"
git status