Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ cache:
- node_modules
matrix:
fast_finish: true
before_install:
- echo -ne '\n' | sudo add-apt-repository ppa:ethereum/ethereum
- sudo apt-get -y update
- sudo apt-get -y install solc
before_script:
- truffle version
script:
- npm run test
- npm run docs
notifications:
slack:
secure: W4FZSabLrzF74f317hutolEHnlq2GBlQxU6b85L5XymrjgLEhlgE16c5Qz7Emoyt6le6PXL+sfG2ujJc3XYys/6hppgrHSAasuJnKCdQNpmMZ9BNyMs6WGkmB3enIf3K/FLXb26AQdwpQdIXuOeJUTf879u+YoiZV0eZH8d3+fsIOyovq9N6X5pKOpDM9iT8gGB4t7fie7xf51s+iUaHxyO9G7jDginZ4rBXHcU7mxCub9z+Z1H8+kCTnPWaF+KKVEXx4Z0nI3+urboD7E4OIP02LwrThQls2CppA3X0EoesTcdvj/HLErY/JvsXIFiFEEHZzB1Wi+k2TiOeLcYwEuHIVij+HPxxlJNX/j8uy01Uk8s4rd+0EhvfdKHJqUKqxH4YN2npcKfHEss7bU3y7dUinXQfYShW5ZewHdvc7pnnxBTfhvmdi64HdNrXAPq+s1rhciH7MmnU+tsm4lhrpr+FBuHzUMA9fOCr7b0SQytZEgWpiUls88gdbh3yG8TjyZxmZJGx09cwEP0q7VoH0UwFh7mIu5XmYdd5tWUhavTiO7YV8cUPn7MvwMsTltB3YBpF/fB26L7ka8zBhCsjm9prW6SVYU/dyO3m91VeZtO/zJFHRDA6Q58JGVW2rgzO39z193qC1EGRXqTie96VwAAtNg8+hRb+bI/CWDVzSPc=
26 changes: 15 additions & 11 deletions scripts/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ DIRECTORY=polymath-developer-portal
WEBSITE_DIRECTORY=versioned_docs
CORE_ROUTE=$PWD


# functions that used to create the documentation
create_docs() {

# getting the all available branches
if [ "$(git branch | grep -w $latestTag)" == "" ];
then
# Check whether the branch is already present or not
if [ "$(git branch -r | grep "origin/$latestTag" | wc -l)" -eq 1 ];
if [ "$(git branch -r | grep "origin/$latestTag" | wc -l)" -ge 1 ];
then
echo "$latesTag Branch is already present on remote"
echo "$latestTag Branch is already present on remote"
exit 0
fi
# Checkout and create the $latestTag branch
Expand All @@ -29,19 +30,21 @@ create_docs() {

echo "Creating the new docs for the version "$latestTag""
cd $WEBSITE_DIRECTORY

# Creating the new directory with name $latestTag
mkdir $latestTag
fi

echo "Generating the API documentation in branch $latestTag"
# Command to generate the documentation using the solidity-docgen
#npm install > /dev/null 2>&1

migrate=$(SOLC_ARGS="openzeppelin-solidity="$CORE_ROUTE"/node_modules/openzeppelin-solidity" \
solidity-docgen $CORE_ROUTE $CORE_ROUTE/contracts $CORE_ROUTE/polymath-developer-portal/)
solidity-docgen -x $CORE_ROUTE/contracts/external,$CORE_ROUTE/contracts/mocks $CORE_ROUTE $CORE_ROUTE/contracts $CORE_ROUTE/polymath-developer-portal/)

echo "Successfully docs are generated..."
echo "Transferring the API DOCS to $latestTag directory"
mv ../../docs/api_* $latestTag

echo "Installing npm dependencies..."
yarn install > /dev/null 2>&1

echo "Gererate versioning docs..."
yarn run version $versionNo

# Commit the changes
echo "Commiting the new changes..."
Expand Down Expand Up @@ -98,8 +101,9 @@ else
echo "There is no version specific folders"
create_docs
else
echo "$(basename "$dir")"
if [ "$(basename "$dir")" == "$latestTag" ]; then
reponame=$(echo $(basename "$dir") | cut -d '-' -f2)
echo $reponame
if [ "$reponame" == "$versionNo" ]; then
reject_docs
fi
fi
Expand Down