-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add convenience script to update the website repo
- Loading branch information
1 parent
2b63fa8
commit d8b4a75
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
COLVARS_WEBSITE_TREE=${1} | ||
if [ -z "${COLVARS_WEBSITE_TREE}" ] ; then | ||
echo "Error: need the full path to the website repository as argument." >&2 | ||
exit 1 | ||
fi | ||
|
||
if grep -sq colvars ${COLVARS_WEBSITE_TREE}/index.html ; then | ||
export COLVARS_WEBSITE_TREE | ||
else | ||
echo "Error: ${COLVARS_WEBSITE_TREE} does not seem to contain a Colvars webpage repository." >&2 | ||
exit 1 | ||
fi | ||
|
||
# If needed, initialize COLVARS_RELEASE in the same way as Makefile would | ||
if [ -z "${COLVARS_RELEASE}" ] ; then | ||
COLVARS_RELEASE=$(git symbolic-ref --short -q HEAD) | ||
fi | ||
if [ -z "${COLVARS_RELEASE}" ] ; then | ||
# If we are not working on a branch, try a tag instead | ||
COLVARS_RELEASE=$(git describe --tags --exact-match) | ||
fi | ||
if [ -z "${COLVARS_RELEASE}" ] ; then | ||
echo "Error: ${COLVARS_RELEASE} is undefined and could not be configured from a Git branch or tag." >&2 | ||
exit 1 | ||
fi | ||
|
||
if make install && pushd ${COLVARS_WEBSITE_TREE} ; then | ||
git add ${COLVARS_RELEASE} | ||
if [ "x${COLVARS_RELEASE}" == "xmaster" ] ; then | ||
git add doxygen | ||
git add colvars-refman-* | ||
fi | ||
git commit -m "Update doc for version \"${COLVARS_RELEASE}\"" | ||
# Hard-code the website repository | ||
git push [email protected]:Colvars/colvars.github.io master | ||
popd | ||
fi |