diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 471f0cc25..000000000 --- a/.travis.yml +++ /dev/null @@ -1,52 +0,0 @@ -sudo: required -dist: trusty -language: php -php: - - 7.0 -jdk: - - openjdk8 -services: - - mysql -addons: - apt: - packages: - - ant - - libxml2-utils -cache: - directories: - - $HOME/.composer/cache - - $HOME/downloads -before_install: - - jdk_switcher use openjdk8 -install: - - phpenv config-add travis.php.ini -before_script: composer install -script: - - mysql --version - - java -version - - ant -version - - travis_fold start "prepare_dependencies" - - ant prepare-test-workspace prepare-workspace prepare-config -DdbUserName=root -DdbAdminName=root - - ant download-solr -DsolrVersion=7.7.2 -DdownloadDir=$HOME/downloads - - cd solr-7.7.2 - - ./bin/solr start - - ./bin/solr create -c opus4 - - cd server/solr/opus4/conf - - rm -f managed-schema schema.xml solrconfig.xml - - ln -s "$TRAVIS_BUILD_DIR/vendor/opus4-repo/search/conf/schema.xml" schema.xml - - ln -s "$TRAVIS_BUILD_DIR/vendor/opus4-repo/search/conf/solrconfig.xml" solrconfig.xml - - cd ../../../../ - - ./bin/solr restart - - cd .. - - travis_fold end "prepare_dependencies" - - travis_fold start "prepare_testing" - - ant reset-testdata - - travis_fold end "prepare_testing" - - mysql opusdb -u root --password='' -e 'SELECT * FROM schema_version' - - composer cs-check - - ./vendor/bin/phpunit --configuration ./tests/phpunit.xml --no-coverage --testsuite library - - ./vendor/bin/phpunit --configuration ./tests/phpunit.xml --no-coverage --testsuite modules - - ./vendor/bin/phpunit --configuration ./tests/phpunit.xml --no-coverage --testsuite admin - - ./vendor/bin/phpunit --configuration ./tests/phpunit.xml --no-coverage --testsuite security - - php ./scripts/opus-smtp-dumpserver.php 2>&1 >>./opus-smtp-dumpserver.log & - - ./vendor/bin/phpunit --configuration ./tests/phpunit.xml --no-coverage --testsuite scripts diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 2138dd3a5..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,134 +0,0 @@ -// Jenkinsfile for the application - -// Define the project name and the build type. A short build dispenses with coverage, since coverage is very time-consuming -def jobNameParts = JOB_NAME.tokenize('/') as String[] -def projectName = jobNameParts[0] -def buildType = "short" - -// If the project has "night" in its name and the master branch or the development branch is present, the build is defined as a long build -if (projectName.contains('night') && (env.BRANCH_NAME == '4.7' || env.BRANCH_NAME == 'master')) { - buildType = "long" -} -pipeline { - /* - Agent (location where the pipeline is executed) is the docker file. - This must have root privileges, because MySQL and Solr must be installed. - Also, creating a docker on the server requires root privileges. - Furthermore, the docker socket of the server must be connected to the docker socket of the docker. - */ - agent { dockerfile {args "-u root -v /var/run/docker.sock:/var/run/docker.sock"}} - environment {XML_CATALOG_FILES = "${WORKSPACE}/tests/resources/opus4-catalog.xml"} - - /* - A long build will not be built on every commit because of the long duration, but will be time-triggered. - Coverage takes so long that it is only built once a week for the development branch and the master branch - */ - triggers { - cron( buildType.equals('long') ? 'H 21 * * 5' : '') - } - - stages { - stage('Composer') { - steps { - // Update Operating system - sh 'sudo apt-get update' - - // Install and update Composer. Additionally install dependencies of OPUS4-Application - sh 'curl -s http://getcomposer.org/installer | php && php composer.phar self-update && php composer.phar install' - } - } - - stage('Install Solr') { - steps { - sh 'sudo bash tests/bin/install_solr_docker.sh' - } - } - - stage('Install MySQL') { - steps { - sh 'sudo bash tests/bin/install_mysql_docker.sh' - } - } - - stage('Prepare Opus4') { - steps { - // Prepare OPUS4 with ant using standard passwords (only test-system) - sh 'ant prepare-workspace prepare-test-workspace prepare-javascript prepare-config lint -DdbUserPassword=root -DdbAdminPassword=root' - - // Install XDebug with Pecl -> Using apt-get would install a old version - sh 'pecl install xdebug-2.8.0 && echo "zend_extension=/usr/lib/php/20151012/xdebug.so" >> /etc/php/7.0/cli/php.ini' - - // Install Mail-Server for mailing-tests - sh 'php ${WORKSPACE}/scripts/opus-smtp-dumpserver.php 2>&1 >> ${WORKSPACE}/tests/workspace/log/opus-smtp-dumpserver.log &' - sh 'chown -R opus4:opus4 .' - } - } - - stage('Analyse') { - steps { - script{ - sh 'php composer.phar analysis' - } - } - } - - stage('Test') { - steps { - script{ - sh 'ant reset-testdata' - if (buildType == 'long'){ - sh 'php composer.phar test-coverage' - } else { - sh 'php composer.phar test' - } - } - } - } - } - - post { - always { - /* - For the cleanup the entire workspace is deleted. - This reduces the server load, since Jenkins does not track the workspaces unnecessarily. - It may be possible to turn off tracking, but I couldn't find an option. - Jenkins must have permissions to delete the workspaces. - */ - sh "chmod -R 777 ." - - // Publishing test-results (unit-tests) - step([ - $class: 'JUnitResultArchiver', - testResults: 'build/phpunit.xml' - ]) - - // Publishing checkstyle-results (coding-style) - step([ - $class: 'hudson.plugins.checkstyle.CheckStylePublisher', - pattern: 'build/checkstyle.xml' - ]) - - // Publishing CPD-results (find duplicated code-fragments) - step([ - $class: 'hudson.plugins.dry.DryPublisher', - pattern: 'build/pmd-cpd.xml' - ]) - - // Publishing PMD-results (static codeanalysis) - step([ - $class: 'hudson.plugins.pmd.PmdPublisher', - pattern: 'build/pmd.xml' - ]) - - // Publishing coverage-report if exists - step([ - $class: 'CloverPublisher', - cloverReportDir: 'build', - cloverReportFileName: 'clover.xml"' - ]) - - // Cleanup - step([$class: 'WsCleanup', externalDelete: 'rm -rf *']) - } - } -}