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 fed3d66
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 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
11 changes: 10 additions & 1 deletion scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,30 @@ 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
git add --all
git commit -m "$GITHUB_PAGES_COMMIT_MESSAGE"
git push --force origin gh-pages

log "Artefacts published" --success

Expand Down

0 comments on commit fed3d66

Please sign in to comment.