diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 06364a1ce..383fa386d 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -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="travisbot@incipio.fr" + 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 diff --git a/scripts/publish.sh b/scripts/publish.sh index 3a5c7acad..c97722e5b 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -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 }