Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docs): Add documentation for released version #400

Merged
merged 4 commits into from
Jul 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 61 additions & 11 deletions deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

set -e # Exit with nonzero exit code if anything fails

# Determine if the current commit is release
TRAVIS_MASTER_BRANCH="master"
TRAVIS_LATEST_RELEASE_WEBSITE_BRANCH="latest-release-website"

# Config variables
REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/${GH_URL}\//git@${GH_URL}:}
Expand All @@ -35,21 +39,67 @@ git clone --quiet --branch=gh-pages $REPO gh-pages || git checkout --orphan gh-p
echo "Before remove gh-pages"
ls -a gh-pages

# Clean gh-pages existing contents
rm -rf gh-pages/* || exit 0
if [ "$TRAVIS_BRANCH" == "$TRAVIS_LATEST_RELEASE_WEBSITE_BRANCH" ]; then
###
### Publish docs on commit in latest-release-website branch
###

# Run the build again so rollup can generate the correct public path urls
cd $TRAVIS_BUILD_DIR
DEPLOY_PUBLIC_PATH=https://sap.github.io/ui5-webcomponents yarn build
echo "Before update release version on gh-pages"

# Move master build folder to gh-pages folder
cp -Rf $TRAVIS_BUILD_DIR/packages/playground/dist/* gh-pages
# Enable use of extended pattern matching operators(*, ?, @, !)
shopt -s extglob

# Remove all folders and files from gh-pages, but folder master
cd gh-pages
rm -v !("master")|| exit 0
cd ..

# Run the build again so rollup can generate the correct public path urls
cd $TRAVIS_BUILD_DIR
DEPLOY_PUBLIC_PATH=https://sap.github.io/ui5-webcomponents/ yarn build

# Move master build folder to gh-pages folder
cp -Rf $TRAVIS_BUILD_DIR/packages/playground/dist/* gh-pages

# put the commit id as version
echo "$(git log -1 HEAD)" > gh-pages/version.txt

echo "After update release version on gh-pages"
ls -a gh-pages

###
### End of publish docs on commit in latest-release-website branch
###

elif [ "$TRAVIS_BRANCH" == "$TRAVIS_MASTER_BRANCH" ]; then
###
### Publish master on every commit in master branch
###

echo "Before update master version on gh-pages"

# Clean gh-pages existing contents
rm -rf gh-pages/master|| exit 0

# Run the build again so rollup can generate the correct public path urls
cd $TRAVIS_BUILD_DIR
DEPLOY_PUBLIC_PATH=https://sap.github.io/ui5-webcomponents/master yarn build

# Move master build folder to gh-pages folder
cp -Rf $TRAVIS_BUILD_DIR/packages/playground/dist/* gh-pages/master

# put the commit id as version
echo "$(git log -1 HEAD)" > gh-pages/version.txt

echo "After update master version on gh-pages"
ls -a gh-pages

###
### End of publish master on every commit in master branch
###
fi

# put the commit id as version
echo "$(git log -1 HEAD)" > gh-pages/version.txt

echo "After update gh-pages"
ls -a gh-pages

# Configure Git
cd gh-pages
Expand Down