-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
47 additions
and
65 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
Empty file.
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 |
---|---|---|
|
@@ -11,74 +11,59 @@ rev=$(git rev-parse --short HEAD) | |
git_user="ÚFAL bot" | ||
git_email="[email protected]" | ||
|
||
pushd . | ||
BRANCH=edge | ||
COMMIT_MSG="Build based on ${rev}" | ||
|
||
# Update pages | ||
cp -u *.md pages/ | ||
cd pages | ||
if [ -z "$TRAVIS_TAG" ]; then | ||
pushd . | ||
|
||
git init -q | ||
git config user.name "$git_user" | ||
git config user.email "$git_email" | ||
# Update pages | ||
cp -u *.md pages/ | ||
cd pages | ||
|
||
touch . | ||
git init -q | ||
git config user.name "$git_user" | ||
git config user.email "$git_email" | ||
|
||
git add -A . | ||
git commit -m "Rebuild Github pages at ${rev}" | ||
git push --force -q "https://$GH_TOKEN@github.com/ufal/lindat-common.git" master:gh-pages > /dev/null 2>&1 | ||
touch . | ||
|
||
popd | ||
git add -A . | ||
git commit -m "Rebuild Github pages at ${rev}" | ||
git push --force -q "https://$GH_TOKEN@github.com/ufal/lindat-common.git" master:gh-pages > /dev/null 2>&1 | ||
|
||
popd | ||
else | ||
BRANCH=releases | ||
COMMIT_MSG="Releasing version ${TRAVIS_TAG}" | ||
fi | ||
|
||
# Update EDGE build | ||
cp -u *.md dist/ | ||
cp -u *.json dist/ | ||
cd dist | ||
|
||
# Fix paths for main files | ||
sed -i 's|dist/public/|public/|m' bower.json | ||
|
||
git init -q | ||
git config user.name "$git_user" | ||
git config user.email "$git_email" | ||
|
||
touch . | ||
|
||
git remote add origin "https://$GH_TOKEN@github.com/ufal/lindat-common.git" | ||
# Fetch remote refs to a specific branch, equivalent to a pull without checkout | ||
git fetch --update-head-ok origin edge:master | ||
git fetch --update-head-ok origin $BRANCH:master | ||
# Make the current working tree the branch HEAD without checking out files | ||
git symbolic-ref HEAD refs/heads/master | ||
# Make sure the stage is clean | ||
|
||
# Track edge branch | ||
git branch --set-upstream-to=origin/edge master | ||
git branch --set-upstream-to=origin/$BRANCH master | ||
|
||
# Chech if there are things to commit | ||
STATUS=`git status --porcelain` | ||
if [ -n "$STATUS" ]; then | ||
git add -A . | ||
git commit -m "Build based on ${rev}" | ||
git push -q origin master:edge > /dev/null 2>&1 | ||
git commit -m "$COMMIT_MSG" | ||
git push -q origin master:$BRANCH > /dev/null 2>&1 | ||
fi | ||
|
||
if [ -z "$TRAVIS_TAG" ]; then | ||
exit 0; | ||
fi | ||
|
||
# Update release - only happens when tagging | ||
|
||
# Revert previous commit to edge | ||
git reset --soft HEAD~1 | ||
# Switch to releases | ||
git fetch --update-head-ok origin releases:master | ||
# Make the current working tree the branch HEAD without checking out files | ||
git symbolic-ref HEAD refs/heads/master | ||
# Make sure again the stage is clean | ||
git reset | ||
|
||
# Track releases branch | ||
git branch --set-upstream-to=origin/releases master | ||
|
||
# Add everything and commit | ||
git add -A . | ||
git commit -m "Releasing version ${TRAVIS_TAG}" | ||
git push -q origin master:releases > /dev/null 2>&1 |
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