Skip to content

Commit

Permalink
Merge pull request #92 from thucke/master
Browse files Browse the repository at this point in the history
TravisCI integration for deploy
  • Loading branch information
thucke committed Jan 23, 2021
2 parents df85408 + 11fdd3a commit 2d93763
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 40 deletions.
29 changes: 22 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
os: linux
language: php

php:
Expand All @@ -7,8 +8,9 @@ php:
env:
global:
- typo3DatabaseHost=localhost typo3DatabaseName=typo3 typo3DatabaseUsername=root typo3DatabasePassword=''
matrix:
# - TYPO3_VERSION=^10
- COMPOSER_MEMORY_LIMIT=3G
jobs:
#- TYPO3_VERSION=^10
- TYPO3_VERSION=^9
services:
- mysql
Expand All @@ -20,9 +22,9 @@ stages:
- name: test
if: branch IN (master, develop) OR branch =~ ^release.*$ OR commit_message =~ force_tests
- name: doxygen
if: branch IN (master)
if: branch = master

matrix:
jobs:
fast_finish: true
include:
- stage: static checks
Expand All @@ -36,9 +38,22 @@ matrix:
organization: "thucke"
script: sonar-scanner -Dproject.settings=Build/.sonar_project.properties -Dsonar.verbose=true
- stage: doxygen
name: "Doxygen generation"
php: 7.2
script: ./Build/Scripts/runTravisDoxygen.sh
name: "Doxygen documentation"
php: 7.4
script: echo "Deploying Doxygen documentation to GitHub pages ..."
before_deploy:
- ./Build/Scripts/runTravisDoxygen.sh
deploy:
provider: pages
skip_cleanup: true
strategy: git
gitthub-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep_history: true
verbose: true
local_dir: ${TRAVIS_BUILD_DIR}/deploy/doxygen/html
on:
branch: master


# specification of build environment
dist: bionic
Expand Down
34 changes: 9 additions & 25 deletions Build/Scripts/runTravisDoxygen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,40 +31,24 @@
# Go to the directory this script is located, so everything else is relative
# to this dir, no matter from where this script is called.
THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd "$THIS_SCRIPT_DIR"
#cd "$THIS_SCRIPT_DIR"
TARGET_DIR="${TRAVIS_BUILD_DIR}"

if [ "$TRAVIS_REPO_SLUG" == "thucke/TYPO3.ext.th_rating" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
echo -e "Starting Doxygen html generation.\n"
mkdir -p $HOME/build/doxygen
set -x
mkdir -p ${TARGET_DIR}/deploy/doxygen
#copy current doxygen configuration to statix place
cp ../.doxygen $HOME/build/doxygen
cp ${THIS_SCRIPT_DIR}/../.doxygen ${TARGET_DIR}/deploy/doxygen

# Get to the Travis build directory, configure git and clone the repo
pushd $HOME/build
#git config --global user.email "travis@travis-ci.org"
#git config --global user.name "travis-ci"
git clone --branch=gh-pages https://${GITHUB_TOKEN}@github.com/thucke/TYPO3.ext.th_rating.git gh-pages

# cleanup documentation
pushd gh-pages
git rm -rf * >/dev/null
popd
pushd ${TARGET_DIR}/deploy/doxygen

# generate new documentation
cd doxygen
echo -e "Starting Doxygen html generation.\n"
doxygen .doxygen >/dev/null
echo -e "Moving Doxygen html to gh-pages branch.\n"
mv -f html/* $HOME/build/gh-pages >/dev/null

# Commit and Push the Changes
cd $HOME/build/gh-pages
echo -e "Publishing gh-pages branch.\n"
git add -f .
git commit -m "Latest doxygen generated doc on successful travis build $TRAVIS_BUILD_NUMBER auto-pushed to gh-pages"
git push -fq origin gh-pages

echo -e "Published Doxygen html to gh-pages.\n"
#doxygen .doxygen 2>&1 >/dev/null
doxygen .doxygen

echo -e "Generated Doxygen html in ${TARGET_DIR}.\n"
popd
fi
4 changes: 2 additions & 2 deletions Build/Scripts/runTravisTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ setUpDockerComposeDotEnv() {
composer require typo3/minimal=${TYPO3_VERSION}
# Restore composer.json
git checkout composer.json
export TYPO3_PATH_WEB=$PWD/.Build/Web
export TYPO3_PATH_WEB=.Build/Web
}

# Load help text into $HELP
Expand Down Expand Up @@ -85,7 +85,7 @@ EOF

# Go to the directory this script is located, so everything else is relative
# to this dir, no matter from where this script is called.
THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
#THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

# Option parsing
# Reset in case getopts has been used previously in the shell
Expand Down
14 changes: 8 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,23 @@
"require" : {
"php" : ">=7.2 <7.5",
"typo3/cms-core" : ">=9.5 <11",
"typo3/cms-extbase" : ">=9.5 <11",
"typo3fluid/fluid": "^2.6.8",
"typo3/cms-extbase": ">=9.5 <11",
"typo3/cms-fluid" : ">=9.5 <11",
"typo3/cms-felogin": ">=9.5 <11",
"typo3/cms-frontend" : ">=9.5 <11",
"typo3fluid/fluid": "^2.3",
"ext-json": "*"
},
"require-dev": {
"typo3/cms-about" : ">=9.5 <11",
"typo3/cms-install" : ">=9.5 <11",
"typo3/cms-frontend" : ">=9.5 <11",
"typo3/cms-fluid-styled-content" : ">=9.5 <11",
"typo3/testing-framework": "^4.11.1",
"roave/security-advisories": "dev-master",
"helmich/typo3-typoscript-lint": "^1.3",
"jangregor/phpstan-prophecy": "^0.8.0",
"typo3/testing-framework": "*",
"roave/security-advisories": "dev-latest",
"friendsofphp/php-cs-fixer": "^2.0",
"nimut/testing-framework": "^1.0 || ^2.0 || ^3.0 || ^4.0 || ^5.0",
"nimut/testing-framework": "*",
"codeception/codeception": "^2.4"
},
"autoload" : {
Expand Down

0 comments on commit 2d93763

Please sign in to comment.