Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9ab5efd

Browse files
authored
Merge pull request #622 from utPLSQL/feature/latest_release_doc_publishing
Updated the way documentation is published for latest release.
2 parents 4002aad + ec498fa commit 9ab5efd

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

.travis/push_docs_to_gh_pages.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,16 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
5353
mkdir -p develop
5454
rm -rf develop/**./* || exit 0
5555
cp -a ../docs/. ./develop
56-
# If a Tagged Build then copy to it's own directory as well.
56+
# If a Tagged Build then copy to it's own directory as well and to the 'latest' release directory
5757
if [ -n "$TRAVIS_TAG" ]; then
5858
echo "Creating ${UTPLSQL_VERSION}"
5959
mkdir -p ${UTPLSQL_VERSION}
6060
rm -rf ${UTPLSQL_VERSION}/**./* || exit 0
6161
cp -a ../docs/. ${UTPLSQL_VERSION}
62+
echo "Populating 'latest' directory"
63+
mkdir -p latest
64+
rm -rf latest/**./* || exit 0
65+
cp -a ../docs/. latest
6266
fi
6367
# Stage changes for commit
6468
git add .
@@ -69,7 +73,6 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
6973
fi
7074
#Changes where detected, so we need to update the version log.
7175
now=$(date +"%d %b %Y - %r")
72-
export latest=" - [Latest development version](develop/) - Created $now"
7376
if [ ! -f index.md ]; then
7477
echo "---" >>index.md
7578
echo "layout: default" >>index.md
@@ -85,13 +88,12 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
8588
fi
8689
#If build running on a TAG - it's a new release - need to add it to documentation
8790
if [ -n "${TRAVIS_TAG}" ]; then
88-
latest_release=" [${TRAVIS_TAG} documentation](${UTPLSQL_VERSION}/) - Created $now"
89-
sed -i '7s@.*@'" - Latest release: ${latest_release}"'@' index.md
90-
#add entry to the end of file - ## Released Version Doc History
91-
echo "- ${latest_release}">>index.md
91+
sed -i '7s@.*@'" - [Latest ${TRAVIS_TAG} documentation](latest/) - Created $now"'@' index.md
92+
#add entry to the top of version history (line end of file - ## Released Version Doc History
93+
sed -i '12i'" - [${TRAVIS_TAG} documentation](${UTPLSQL_VERSION}/) - Created $now" index.md
9294
fi
9395
#replace 4th line in log
94-
sed -i '8s@.*@'"${latest}"'@' index.md
96+
sed -i '8s@.*@'" - [Latest development version](develop/) - Created $now"'@' index.md
9597
#Add and Commit the changes back to pages repo.
9698
git add .
9799
git commit -m "Deploy to gh-pages branch: base commit ${SHA}"

0 commit comments

Comments
 (0)