|
Play Framework/Scala example source code file (deployApiDocs)
The deployApiDocs Play Framework example source code
#! /bin/bash
# Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
# Usage: deployApiDocs <branch> [ <tag> ]
#
# If you have checked out a tag, then you must supply the branch to deploy the docs to.
#
# If you want the repo tagged, then supply a tag argument
set -e
BRANCH=$1
TAG=$2
if [ -z "$BRANCH" ]
then
echo You must specify a branch
fi
PLAYVERSION=""
if [ -n "$TAG" ]
then
echo Will tag version $TAG
PLAYVERSION=-Dplay.version=$TAG
fi
# build the docs
./build $PLAYVERSION -Dgit.branch=$BRANCH api-docs
mkdir -p target
cd target
# clone the git repo if it's not already there
if [ -d play-generated-docs ]
then
cd play-generated-docs
git fetch
else
git clone git@github.com:playframework/play-generated-docs.git
cd play-generated-docs
fi
# Create the branch if it doesn't already exist
if git branch -a | grep -q $BRANCH
then
git checkout $BRANCH
git merge origin/$BRANCH
else
git checkout -b $BRANCH
fi
rm -r *
mv ../../src/play-docs/target/scala-2.10/apidocs api
if ! git diff -w --quiet
then
git add --all
# Commit changes
echo "Docs have changed, committing and pushing..."
if [ -z "$TAG" ]
then
git commit -m "Api docs changed"
else
git commit -m "Update for $TAG"
fi
git push origin $BRANCH
else
echo "No changes in docs"
fi
if [ -n "$TAG" ]
then
echo "Tagging docs..."
git tag -a -m $TAG $TAG
git push --tags
fi
Other Play Framework source code examplesHere is a short list of links related to this Play Framework deployApiDocs source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.