Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
Minor improvements in bash deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Oct 9, 2015
1 parent 8b1b180 commit 47362ab
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
11 changes: 8 additions & 3 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ configTravis() {
if [[ -z "$GITHUB_USER_NAME" ]] || [[ -z "$GITHUB_USER_EMAIL" ]]; then
log "Could not configure Git user" --error
else
GITHUB_USER_NAME="TravisBot"
GH_USER_EMAIL="[email protected]"
echo " user: $GITHUB_USER_NAME"
echo " temail: $GITHUB_USER_EMAIL"

git config --global user.name "$GITHUB_USER_NAME"
git config --global user.email "$GITHUB_USER_EMAIL"
fi

log "Install necessary packages";
pip install ghp-import --user
echo "install mkdocs --user"
pip install mkdocs --user
echo "global require halleck45/phpmetrics --no-update"
composer global require halleck45/phpmetrics --no-update
echo "composer global require apigen/apigen --no-update"
composer global require apigen/apigen --no-update

log "Deployment configuration read" --success
Expand Down
14 changes: 12 additions & 2 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,33 @@ publishToGithubPages() {
git clone "$GITHUB_PAGES_REMOTE" gh-pages --branch=gh-pages --single-branch

log "Generates PhpMetrics reports (x3)"
echo "phpmetrics --report-html=dist/reports/phpmetrics/app.html src"
phpmetrics --report-html=dist/reports/phpmetrics/app.html src
echo "phpmetrics --report-html=dist/reports/phpmetrics/api-bundle.html src/ApiBundle"
phpmetrics --report-html=dist/reports/phpmetrics/api-bundle.html src/ApiBundle
echo "phpmetrics --report-html=dist/reports/phpmetrics/front-bundle.html src/FrontBundle"
phpmetrics --report-html=dist/reports/phpmetrics/front-bundle.html src/FrontBundle

log "Generates PHPDoc"
echo "apigen generate --source src --destination dist/api-doc"
apigen generate --source src --destination dist/api-doc

log "Build GitHub Pages website"
echo "mkdocs build --clean"
mkdocs build --clean

log "Publish artefacts to GitHub Pages"
echo "mv -f dist/api-doc gh-pages"
mv -f dist/api-doc gh-pages
echo "mv -f dist/reports gh-pages"
mv -f dist/reports gh-pages

ghp-import -m "$GITHUB_PAGES_COMMIT_MESSAGE" -r "$GITHUB_PAGES_REMOTE" -p gh-pages
cd gh-pages
git add --all
git commit -m "$GITHUB_PAGES_COMMIT_MESSAGE"
git push --force origin gh-pages

log "Artefacts published" --success
log "Artefacts published, head to https://in6pio.github.io/Incipio" --success

return 0
}
Expand Down

0 comments on commit 47362ab

Please sign in to comment.