Commit b5e08885 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Update scripts/create-tags.sh

parent c213e07b
......@@ -65,7 +65,7 @@ When you are ready with your changes:
The script will check that:
- You are on the *devel* branch in all hpp repositories.
- All hpp repositories are clean (no local changes).
3. Push the tags to github. (TODO add a script)
3. Push the tags to github.
### Benchmarked release
......
......@@ -25,28 +25,62 @@ hpp-walkgen hpp-wholebody-step hpp-wholebody-step-corba \
hpp-manipulation hpp-manipulation-corba hpp-manipulation-urdf \
hpp-gepetto-viewer hpp-gui hpp-plot"
c_good="\e[32m"
c_bad="\e[31m"
c_reset="\e[0m"
echo "Devel directory is $DEVEL_HPP_DIR"
# Check that
# - current branch is devel
# - local repository if clean
# - remote origin is something like https://github.com/humanoid-path-planner/...
# - there is no difference between origin/devel
# and the current working directory.
# - working directory is clean
for pkg in ${pkg_main}; do
GIT="git -C ${DEVEL_HPP_DIR}/src/${pkg}"
current_branch=$(${GIT} rev-parse --abbrev-ref HEAD)
if [ ! "${current_branch}" == "devel" ]; then
echo "${pkg}: Current branch is ${current_branch}. Should be devel."
#exit 1
remote_origin=$(${GIT} remote get-url origin)
if [[ ! "$remote_origin" =~ ^.*github.com[:/]humanoid-path-planner/${pkg}.*$ ]]; then
echo -e "${pkg}: ${c_bad}Remote 'origin' is not the main repo. Should be https://github.com/humanoid-path-planner/${pkg}${c_reset}"
# exit 1
fi
#current_branch=$(${GIT} rev-parse --abbrev-ref HEAD)
#if [ ! "${current_branch}" == "devel" ]; then
# echo "${pkg}: Current branch is ${current_branch}. Should be devel."
# exit 1
#fi
${GIT} update-index -q --refresh
CHANGED=$(${GIT} diff-index --name-only origin/devel --)
if [ -n "${CHANGED}" ]; then
echo -e "${pkg}: ${c_bad}Not synchronized with origin/devel${c_reset}."
exit 1
fi
CHANGED=$(${GIT} diff-index --name-only HEAD --)
if [ -n "${CHANGED}" ]; then
echo "${pkg}: Working directory not clean."
#exit 1
echo -e "${pkg}: ${c_bad}Working directory not clean${c_reset}."
exit 1
fi
echo -e "${pkg}: ${c_good}Ok${c_reset}."
done
exit 0
# Create the tags
echo "Create tags ${version}"
for pkg in ${pkg_main}; do
GIT="git -C ${DEVEL_HPP_DIR}/src/${pkg}"
echo "Create tag ${version} in ${pkg}"
${GIT} tag -a -m "Version ${version}" ${version}
echo -e "${pkg}: ${c_good}Ok${c_reset}."
done
# Push the tags
read -p "Push the tags ? [y/N]" answer
if [[ "${answer}" =~ ^[yY]$ ]]; then
echo "Push tags ${version} to origin"
for pkg in ${pkg_main}; do
GIT="git -C ${DEVEL_HPP_DIR}/src/${pkg}"
${GIT} push origin ${version}
echo -e "${pkg}: ${c_good}Ok${c_reset}."
done
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment