diff --git a/.drone.jsonnet b/.drone.jsonnet new file mode 100644 index 0000000000000..54eb0723f51d5 --- /dev/null +++ b/.drone.jsonnet @@ -0,0 +1,184 @@ +local volumes = [ + { + name: "composer-cache", + path: "/tmp/composer-cache", + }, +]; + +local hostvolumes = [ + { + name: "composer-cache", + host: {path: "/tmp/composer-cache"} + }, +]; + +local composer(phpversion) = { + name: "composer", + image: "joomlaprojects/docker-images:php" + phpversion, + volumes: volumes, + commands: ["php -v", "composer install"] +}; + +local prepare(phpversion) = { + name: "prepare", + image: "joomlaprojects/docker-images:php" + phpversion, + environment: {PGPASSWORD: "joomla_ut"}, + commands: [ + "php -v", + "sleep 20", + "mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < \"tests/unit/schema/mysql.sql\"", + "psql -h postgres -d joomla_ut -U joomla_ut -a -f \"tests/unit/schema/postgresql.sql\"" + ] +}; + +local phpunit(phpversion, ignore_result) = { + name: "PHPUnit", + image: "joomlaprojects/docker-images:php" + phpversion, + [if ignore_result then "failure"]: "ignore", + commands: ["libraries/vendor/bin/phpunit"] +}; + +local pipeline(phpversion, ignore_result) = { + kind: "pipeline", + name: "PHP " + phpversion, + volumes: hostvolumes, + steps: [ + composer(phpversion), + prepare(phpversion), + phpunit(phpversion, ignore_result) + ], + services: [ + { + name: "mysql", + image: "mysql:5.7", + environment: { + MYSQL_USER: "joomla_ut", + MYSQL_PASSWORD: "joomla_ut", + MYSQL_ROOT_PASSWORD: "joomla_ut", + MYSQL_DATABASE: "joomla_ut" + } + }, + { + name: "postgres", + image: "postgres:11-alpine", + ports: [5432], + environment: { + POSTGRES_USER: "joomla_ut", + POSTGRES_PASSWORD: "joomla_ut", + POSTGRES_DB: "joomla_ut" + } + }, + { + name: "memcached", + image: "memcached:alpine" + }, + { + name:"redis", + image: "redis:alpine" + } + ] +}; + +[ + { + kind: "pipeline", + name: "Codequality", + volumes: hostvolumes, + steps: [ + { + name: "composer", + image: "joomlaprojects/docker-images:php7.4", + volumes: volumes, + commands: [ + "php -v", + "composer install", + "composer require phpmd/phpmd" + ] + }, + { + name: "phpcs", + image: "joomlaprojects/docker-images:php7.2", + commands: [ + "php -v", + "libraries/vendor/bin/phpcs --report=full --encoding=utf-8 --extensions=php -p --standard=build/phpcs/Joomla ." + ] + }, + { + name: "javascript", + image: "joomlaprojects/docker-images:systemtests", + commands: [ + "echo $(date)", + "export DISPLAY=:0", + "Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &", + "sleep 3", + "fluxbox > /dev/null 2>&1 &", + "cd tests/javascript", + "npm install", + "cd ../..", + "tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run", + "echo $(date)" + ] + } + ] + }, + pipeline("5.3", false), + pipeline("5.4", false), + pipeline("5.5", false), + pipeline("5.6", false), + pipeline("7.0", false), + pipeline("7.1", false), + pipeline("7.2", false), + pipeline("7.3", false), + pipeline("7.4", false), + pipeline("8.0", true), + { + kind: "pipeline", + name: "package", + steps: [ + { + name: "packager", + image: "joomlaprojects/docker-images:packager", + environment: { + FTP_USERNAME: {from_secret: "ftpusername"}, + FTP_PASSWORD: {from_secret: "ftppassword"}, + FTP_HOSTNAME: "ci.joomla.org", + FTP_PORT: "21", + FTP_DEST_DIR: "/artifacts", + FTP_VERIFY: "false", + FTP_SECURE: "true", + HTTP_ROOT: "https://ci.joomla.org/artifacts", + DRONE_PULL_REQUEST: "DRONE_PULL_REQUEST", + DRONE_COMMIT: "DRONE_COMMIT", + GITHUB_TOKEN: {from_secret: "github_token"} + }, + commands: [ + "if [ $DRONE_REPO_NAME != 'joomla-cms' ]; then echo \"The packager only runs on the joomla/joomla-cms repo\"; exit 0; fi", + "/bin/drone_build.sh" + ] + } + ] + }, + { + kind: "pipeline", + name: "Rips", + steps: [ + { + name: "analysis3x", + image: "rips/rips-cli:3.2.2", + when: { + repo: ["joomla/joomla-cms", "joomla/cms-security"], + branch: ["staging"] + }, + commands: [ + "export RIPS_BASE_URI='https://api.rips.joomla.org'", + "rips-cli rips:list --table=scans --parameter filter='{\"__and\":[{\"__lessThan\":{\"percent\":100}}]}'", + "rips-cli rips:scan:start --progress --application=1 --threshold=0 --path=$(pwd) --remove-code --remove-upload --tag=$DRONE_REPO_NAMESPACE-$DRONE_BRANCH || { echo \"Please contact the security team at security@joomla.org\"; exit 1; }" + ], + environment: { + RIPS_EMAIL: {from_secret:"RIPS_EMAIL"}, + RIPS_PASSWORD: {from_secret: "RIPS_PASSWORD"} + } + } + ] + } +] diff --git a/.drone.yml b/.drone.yml index 8b240f0225b5b..dcdf17d9681d6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,108 +1,727 @@ --- kind: pipeline -name: default +name: Codequality -clone: +platform: + os: linux + arch: amd64 steps: - - name: phpcs - image: joomlaprojects/docker-images:phpcs1.5 - commands: - - echo $(date) - - /usr/local/vendor/bin/phpcs --report=full --encoding=utf-8 --extensions=php -p --standard=build/phpcs/Joomla . - - echo $(date) - - - name: restore-cache - image: drillster/drone-volume-cache - settings: - restore: true - mount: - - ./tests/javascript/node_modules - cache_key: [ DRONE_REPO_NAMESPACE, DRONE_REPO_NAME, DRONE_BRANCH, DRONE_STAGE_NUMBER ] - volumes: - - name: cache - path: /cache - - - name: javascript - image: joomlaprojects/docker-images:systemtests - commands: - - echo $(date) - - export DISPLAY=:0 - - Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 & - - sleep 3 - - fluxbox > /dev/null 2>&1 & - - cd tests/javascript - - npm install - - cd ../.. - - tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run - - echo $(date) - - - name: rebuild-cache - image: drillster/drone-volume-cache - settings: - rebuild: true - mount: - - ./tests/javascript/node_modules - cache_key: [ DRONE_REPO_NAMESPACE, DRONE_REPO_NAME, DRONE_BRANCH, DRONE_STAGE_NUMBER ] - volumes: - - name: cache - path: /cache - - - name: analysis3x - image: rips/rips-cli:3.2.2 - when: - repo: - - joomla/joomla-cms - - joomla/cms-security - branch: - - staging - commands: - - export RIPS_BASE_URI='https://api.rips.joomla.org' - - rips-cli rips:list --table=scans --parameter filter='{"__and":[{"__lessThan":{"percent":100}}]}' - - rips-cli rips:scan:start --progress --application=1 --threshold=0 --path=$(pwd) --remove-code --remove-upload --tag=$DRONE_REPO_NAMESPACE-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; } - environment: - RIPS_EMAIL: - from_secret: RIPS_EMAIL - RIPS_PASSWORD: - from_secret: RIPS_PASSWORD +- name: composer + image: joomlaprojects/docker-images:php7.4 + commands: + - php -v + - composer install + - composer require phpmd/phpmd + volumes: + - name: composer-cache + path: /tmp/composer-cache + +- name: phpcs + image: joomlaprojects/docker-images:php7.2 + commands: + - php -v + - libraries/vendor/bin/phpcs --report=full --encoding=utf-8 --extensions=php -p --standard=build/phpcs/Joomla . + +- name: javascript + image: joomlaprojects/docker-images:systemtests + commands: + - echo $(date) + - export DISPLAY=:0 + - Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 & + - sleep 3 + - fluxbox > /dev/null 2>&1 & + - cd tests/javascript + - npm install + - cd ../.. + - tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run + - echo $(date) + +volumes: +- name: composer-cache + host: + path: /tmp/composer-cache + +--- +kind: pipeline +name: PHP 5.3 + +platform: + os: linux + arch: amd64 + +steps: +- name: composer + image: joomlaprojects/docker-images:php5.3 + commands: + - php -v + - composer install + volumes: + - name: composer-cache + path: /tmp/composer-cache + +- name: prepare + image: joomlaprojects/docker-images:php5.3 + commands: + - php -v + - sleep 20 + - mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql" + - psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql" + environment: + PGPASSWORD: joomla_ut + +- name: PHPUnit + image: joomlaprojects/docker-images:php5.3 + commands: + - libraries/vendor/bin/phpunit + +services: +- name: mysql + image: mysql:5.7 + environment: + MYSQL_DATABASE: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_USER: joomla_ut + +- name: postgres + image: postgres:11-alpine + environment: + POSTGRES_DB: joomla_ut + POSTGRES_PASSWORD: joomla_ut + POSTGRES_USER: joomla_ut + ports: + - 5432 + +- name: memcached + image: memcached:alpine + +- name: redis + image: redis:alpine volumes: -- name: cache +- name: composer-cache host: - path: /tmp/cache + path: /tmp/composer-cache + +--- +kind: pipeline +name: PHP 5.4 -branches: - exclude: [ l10n_* ] +platform: + os: linux + arch: amd64 + +steps: +- name: composer + image: joomlaprojects/docker-images:php5.4 + commands: + - php -v + - composer install + volumes: + - name: composer-cache + path: /tmp/composer-cache + +- name: prepare + image: joomlaprojects/docker-images:php5.4 + commands: + - php -v + - sleep 20 + - mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql" + - psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql" + environment: + PGPASSWORD: joomla_ut + +- name: PHPUnit + image: joomlaprojects/docker-images:php5.4 + commands: + - libraries/vendor/bin/phpunit + +services: +- name: mysql + image: mysql:5.7 + environment: + MYSQL_DATABASE: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_USER: joomla_ut + +- name: postgres + image: postgres:11-alpine + environment: + POSTGRES_DB: joomla_ut + POSTGRES_PASSWORD: joomla_ut + POSTGRES_USER: joomla_ut + ports: + - 5432 + +- name: memcached + image: memcached:alpine + +- name: redis + image: redis:alpine + +volumes: +- name: composer-cache + host: + path: /tmp/composer-cache + +--- +kind: pipeline +name: PHP 5.5 + +platform: + os: linux + arch: amd64 + +steps: +- name: composer + image: joomlaprojects/docker-images:php5.5 + commands: + - php -v + - composer install + volumes: + - name: composer-cache + path: /tmp/composer-cache + +- name: prepare + image: joomlaprojects/docker-images:php5.5 + commands: + - php -v + - sleep 20 + - mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql" + - psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql" + environment: + PGPASSWORD: joomla_ut + +- name: PHPUnit + image: joomlaprojects/docker-images:php5.5 + commands: + - libraries/vendor/bin/phpunit + +services: +- name: mysql + image: mysql:5.7 + environment: + MYSQL_DATABASE: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_USER: joomla_ut + +- name: postgres + image: postgres:11-alpine + environment: + POSTGRES_DB: joomla_ut + POSTGRES_PASSWORD: joomla_ut + POSTGRES_USER: joomla_ut + ports: + - 5432 + +- name: memcached + image: memcached:alpine + +- name: redis + image: redis:alpine + +volumes: +- name: composer-cache + host: + path: /tmp/composer-cache + +--- +kind: pipeline +name: PHP 5.6 + +platform: + os: linux + arch: amd64 + +steps: +- name: composer + image: joomlaprojects/docker-images:php5.6 + commands: + - php -v + - composer install + volumes: + - name: composer-cache + path: /tmp/composer-cache + +- name: prepare + image: joomlaprojects/docker-images:php5.6 + commands: + - php -v + - sleep 20 + - mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql" + - psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql" + environment: + PGPASSWORD: joomla_ut + +- name: PHPUnit + image: joomlaprojects/docker-images:php5.6 + commands: + - libraries/vendor/bin/phpunit + +services: +- name: mysql + image: mysql:5.7 + environment: + MYSQL_DATABASE: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_USER: joomla_ut + +- name: postgres + image: postgres:11-alpine + environment: + POSTGRES_DB: joomla_ut + POSTGRES_PASSWORD: joomla_ut + POSTGRES_USER: joomla_ut + ports: + - 5432 + +- name: memcached + image: memcached:alpine + +- name: redis + image: redis:alpine + +volumes: +- name: composer-cache + host: + path: /tmp/composer-cache + +--- +kind: pipeline +name: PHP 7.0 + +platform: + os: linux + arch: amd64 + +steps: +- name: composer + image: joomlaprojects/docker-images:php7.0 + commands: + - php -v + - composer install + volumes: + - name: composer-cache + path: /tmp/composer-cache + +- name: prepare + image: joomlaprojects/docker-images:php7.0 + commands: + - php -v + - sleep 20 + - mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql" + - psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql" + environment: + PGPASSWORD: joomla_ut + +- name: PHPUnit + image: joomlaprojects/docker-images:php7.0 + commands: + - libraries/vendor/bin/phpunit + +services: +- name: mysql + image: mysql:5.7 + environment: + MYSQL_DATABASE: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_USER: joomla_ut + +- name: postgres + image: postgres:11-alpine + environment: + POSTGRES_DB: joomla_ut + POSTGRES_PASSWORD: joomla_ut + POSTGRES_USER: joomla_ut + ports: + - 5432 + +- name: memcached + image: memcached:alpine + +- name: redis + image: redis:alpine + +volumes: +- name: composer-cache + host: + path: /tmp/composer-cache + +--- +kind: pipeline +name: PHP 7.1 + +platform: + os: linux + arch: amd64 + +steps: +- name: composer + image: joomlaprojects/docker-images:php7.1 + commands: + - php -v + - composer install + volumes: + - name: composer-cache + path: /tmp/composer-cache + +- name: prepare + image: joomlaprojects/docker-images:php7.1 + commands: + - php -v + - sleep 20 + - mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql" + - psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql" + environment: + PGPASSWORD: joomla_ut + +- name: PHPUnit + image: joomlaprojects/docker-images:php7.1 + commands: + - libraries/vendor/bin/phpunit + +services: +- name: mysql + image: mysql:5.7 + environment: + MYSQL_DATABASE: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_USER: joomla_ut + +- name: postgres + image: postgres:11-alpine + environment: + POSTGRES_DB: joomla_ut + POSTGRES_PASSWORD: joomla_ut + POSTGRES_USER: joomla_ut + ports: + - 5432 + +- name: memcached + image: memcached:alpine + +- name: redis + image: redis:alpine + +volumes: +- name: composer-cache + host: + path: /tmp/composer-cache + +--- +kind: pipeline +name: PHP 7.2 + +platform: + os: linux + arch: amd64 + +steps: +- name: composer + image: joomlaprojects/docker-images:php7.2 + commands: + - php -v + - composer install + volumes: + - name: composer-cache + path: /tmp/composer-cache + +- name: prepare + image: joomlaprojects/docker-images:php7.2 + commands: + - php -v + - sleep 20 + - mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql" + - psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql" + environment: + PGPASSWORD: joomla_ut + +- name: PHPUnit + image: joomlaprojects/docker-images:php7.2 + commands: + - libraries/vendor/bin/phpunit + +services: +- name: mysql + image: mysql:5.7 + environment: + MYSQL_DATABASE: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_USER: joomla_ut + +- name: postgres + image: postgres:11-alpine + environment: + POSTGRES_DB: joomla_ut + POSTGRES_PASSWORD: joomla_ut + POSTGRES_USER: joomla_ut + ports: + - 5432 + +- name: memcached + image: memcached:alpine + +- name: redis + image: redis:alpine + +volumes: +- name: composer-cache + host: + path: /tmp/composer-cache + +--- +kind: pipeline +name: PHP 7.3 + +platform: + os: linux + arch: amd64 + +steps: +- name: composer + image: joomlaprojects/docker-images:php7.3 + commands: + - php -v + - composer install + volumes: + - name: composer-cache + path: /tmp/composer-cache + +- name: prepare + image: joomlaprojects/docker-images:php7.3 + commands: + - php -v + - sleep 20 + - mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql" + - psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql" + environment: + PGPASSWORD: joomla_ut + +- name: PHPUnit + image: joomlaprojects/docker-images:php7.3 + commands: + - libraries/vendor/bin/phpunit + +services: +- name: mysql + image: mysql:5.7 + environment: + MYSQL_DATABASE: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_USER: joomla_ut + +- name: postgres + image: postgres:11-alpine + environment: + POSTGRES_DB: joomla_ut + POSTGRES_PASSWORD: joomla_ut + POSTGRES_USER: joomla_ut + ports: + - 5432 + +- name: memcached + image: memcached:alpine + +- name: redis + image: redis:alpine + +volumes: +- name: composer-cache + host: + path: /tmp/composer-cache + +--- +kind: pipeline +name: PHP 7.4 + +platform: + os: linux + arch: amd64 + +steps: +- name: composer + image: joomlaprojects/docker-images:php7.4 + commands: + - php -v + - composer install + volumes: + - name: composer-cache + path: /tmp/composer-cache + +- name: prepare + image: joomlaprojects/docker-images:php7.4 + commands: + - php -v + - sleep 20 + - mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql" + - psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql" + environment: + PGPASSWORD: joomla_ut + +- name: PHPUnit + image: joomlaprojects/docker-images:php7.4 + commands: + - libraries/vendor/bin/phpunit + +services: +- name: mysql + image: mysql:5.7 + environment: + MYSQL_DATABASE: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_USER: joomla_ut + +- name: postgres + image: postgres:11-alpine + environment: + POSTGRES_DB: joomla_ut + POSTGRES_PASSWORD: joomla_ut + POSTGRES_USER: joomla_ut + ports: + - 5432 + +- name: memcached + image: memcached:alpine + +- name: redis + image: redis:alpine + +volumes: +- name: composer-cache + host: + path: /tmp/composer-cache + +--- +kind: pipeline +name: PHP 8.0 + +platform: + os: linux + arch: amd64 + +steps: +- name: composer + image: joomlaprojects/docker-images:php8.0 + commands: + - php -v + - composer install + volumes: + - name: composer-cache + path: /tmp/composer-cache + +- name: prepare + image: joomlaprojects/docker-images:php8.0 + commands: + - php -v + - sleep 20 + - mysql --host=mysql --user=joomla_ut --password=joomla_ut --database=joomla_ut < "tests/unit/schema/mysql.sql" + - psql -h postgres -d joomla_ut -U joomla_ut -a -f "tests/unit/schema/postgresql.sql" + environment: + PGPASSWORD: joomla_ut + +- name: PHPUnit + image: joomlaprojects/docker-images:php8.0 + commands: + - libraries/vendor/bin/phpunit + failure: ignore + +services: +- name: mysql + image: mysql:5.7 + environment: + MYSQL_DATABASE: joomla_ut + MYSQL_PASSWORD: joomla_ut + MYSQL_ROOT_PASSWORD: joomla_ut + MYSQL_USER: joomla_ut + +- name: postgres + image: postgres:11-alpine + environment: + POSTGRES_DB: joomla_ut + POSTGRES_PASSWORD: joomla_ut + POSTGRES_USER: joomla_ut + ports: + - 5432 + +- name: memcached + image: memcached:alpine + +- name: redis + image: redis:alpine + +volumes: +- name: composer-cache + host: + path: /tmp/composer-cache --- kind: pipeline name: package +platform: + os: linux + arch: amd64 + steps: - - name: packager - image: joomlaprojects/docker-images:packager - environment: - FTP_USERNAME: - from_secret: ftpusername - FTP_PASSWORD: - from_secret: ftppassword - FTP_HOSTNAME: ci.joomla.org - FTP_PORT: "21" - FTP_DEST_DIR: /artifacts - FTP_VERIFY: "false" - FTP_SECURE: "true" - HTTP_ROOT: "https://ci.joomla.org/artifacts" - DRONE_PULL_REQUEST: DRONE_PULL_REQUEST - DRONE_COMMIT: DRONE_COMMIT - GITHUB_TOKEN: - from_secret: github_token - commands: - - if [ $DRONE_REPO_NAME != 'joomla-cms' ]; then echo "The packager only runs on the joomla/joomla-cms repo"; exit 0; fi - - /bin/drone_build.sh +- name: packager + image: joomlaprojects/docker-images:packager + commands: + - if [ $DRONE_REPO_NAME != 'joomla-cms' ]; then echo "The packager only runs on the joomla/joomla-cms repo"; exit 0; fi + - /bin/drone_build.sh + environment: + DRONE_COMMIT: DRONE_COMMIT + DRONE_PULL_REQUEST: DRONE_PULL_REQUEST + FTP_DEST_DIR: /artifacts + FTP_HOSTNAME: ci.joomla.org + FTP_PASSWORD: + from_secret: ftppassword + FTP_PORT: 21 + FTP_SECURE: true + FTP_USERNAME: + from_secret: ftpusername + FTP_VERIFY: false + GITHUB_TOKEN: + from_secret: github_token + HTTP_ROOT: https://ci.joomla.org/artifacts +--- +kind: pipeline +name: Rips + +platform: + os: linux + arch: amd64 + +steps: +- name: analysis3x + image: rips/rips-cli:3.2.2 + commands: + - export RIPS_BASE_URI='https://api.rips.joomla.org' + - rips-cli rips:list --table=scans --parameter filter='{"__and":[{"__lessThan":{"percent":100}}]}' + - rips-cli rips:scan:start --progress --application=1 --threshold=0 --path=$(pwd) --remove-code --remove-upload --tag=$DRONE_REPO_NAMESPACE-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; } + environment: + RIPS_EMAIL: + from_secret: RIPS_EMAIL + RIPS_PASSWORD: + from_secret: RIPS_PASSWORD + when: + branch: + - staging + repo: + - joomla/joomla-cms + - joomla/cms-security --- kind: signature -hmac: a825707d539b95fb82da2affd7ba513094430f48cd0d829d38c5f59a6b412d78 +hmac: 891055d296eb627e4c15bb3a6e672a3171d33e74f73d916075cf384b5c9a552e ... diff --git a/.hound.yml b/.hound.yml deleted file mode 100644 index 87a3326e2f952..0000000000000 --- a/.hound.yml +++ /dev/null @@ -1,13 +0,0 @@ -fail_on_violations: false - -scss: - enabled: false - -jshint: - enabled: false - -eslint: - enabled: false - -ruby: - enabled: false diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 068ed2c5b046b..0000000000000 --- a/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -# Forces new Travis-CI Infrastructure -sudo: false - -language: php - -env: - global: - - RUN_UNIT_TESTS="yes" - - INSTALL_APCU="yes" - - INSTALL_MEMCACHED="yes" - - INSTALL_REDIS="yes" - -matrix: - fast_finish: true - include: - # Requires older Precise image - - php: 5.3 - env: - - INSTALL_APC="yes" - - INSTALL_APCU="no" - - INSTALL_MEMCACHE="yes" - sudo: true - dist: precise - # The new Trusty image has issues with running APC, do not enable it here - - php: 5.4 - env: - - INSTALL_APCU="no" - - INSTALL_MEMCACHE="yes" - dist: trusty - - php: 5.5 - env: - - INSTALL_MEMCACHE="yes" - dist: trusty - - php: 5.6 - env: - - INSTALL_MEMCACHE="yes" - dist: trusty - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4 - - php: nightly - allow_failures: - - php: nightly - -services: - - memcache - - memcached - - redis-server - - mysql - - postgresql - -before_script: - # Make sure all dev dependencies are installed - - if [[ $RUN_UNIT_TESTS == "yes" ]]; then bash build/travis/unit-tests.sh $PWD; fi - -script: - - if [[ $RUN_UNIT_TESTS == "yes" ]]; then libraries/vendor/bin/phpunit --configuration travisci-phpunit.xml; fi - -branches: - except: - - 2.5.x diff --git a/README.md b/README.md index 476e093ecb3e4..38a4c41697567 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cms/readme)](https://github.com/igrigorik/ga-beacon) [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com) +Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cms/readme)](https://github.com/igrigorik/ga-beacon) ==================== Build Status --------------------- -| Travis-CI | Drone-CI | AppVeyor | -| ------------- | ------------- | ------------- | -| [![Build Status](https://travis-ci.org/joomla/joomla-cms.svg?branch=staging)](https://travis-ci.org/joomla/joomla-cms) | [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/staging?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | +| Drone-CI | AppVeyor | +| ------------- | ------------- | +| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/staging?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | What is this? --------------------- diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b05b6307863a3..097d6fe64ba8a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,19 +1,18 @@ - - - - - - - + + + + + + - - - + + + - --> diff --git a/tests/unit/suites/libraries/joomla/cache/storage/JCacheStorageMemcachedTest.php b/tests/unit/suites/libraries/joomla/cache/storage/JCacheStorageMemcachedTest.php index 8617baa237deb..ce926e982cf06 100644 --- a/tests/unit/suites/libraries/joomla/cache/storage/JCacheStorageMemcachedTest.php +++ b/tests/unit/suites/libraries/joomla/cache/storage/JCacheStorageMemcachedTest.php @@ -32,8 +32,7 @@ protected function setUp() if ($dsn) { - - // First let's trim the redis: part off the front of the DSN if it exists. + // First let's trim the memcached: part off the front of the DSN if it exists. if (strpos($dsn, 'memcached:') === 0) { $dsn = substr($dsn, 10); @@ -60,6 +59,10 @@ protected function setUp() } } } + else + { + $this->markTestSkipped('No configuration for Memcached given'); + } try { @@ -67,7 +70,7 @@ protected function setUp() } catch (JCacheExceptionConnecting $e) { - $this->markTestSkipped('Failed to connect to Memcached'); + $this->fail('Failed to connect to Memcached'); } // Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds) diff --git a/tests/unit/suites/libraries/joomla/cache/storage/JCacheStorageRedisTest.php b/tests/unit/suites/libraries/joomla/cache/storage/JCacheStorageRedisTest.php index 9104410f1b158..790a17ce014cd 100644 --- a/tests/unit/suites/libraries/joomla/cache/storage/JCacheStorageRedisTest.php +++ b/tests/unit/suites/libraries/joomla/cache/storage/JCacheStorageRedisTest.php @@ -27,33 +27,8 @@ protected function setUp() parent::setUp(); - // Mock the returns on JApplicationCms::get() to use the default values - JFactory::$application->expects($this->any()) - ->method('get') - ->will($this->returnCallback(array($this, 'applicationGetterCallback'))); - - $this->handler = new JCacheStorageRedis; - - // This adapter doesn't throw an Exception on a connection failure so we'll have to use Reflection to get into the class to check it - if (!(TestReflection::getValue($this->handler, '_redis') instanceof Redis)) - { - $this->markTestSkipped('Failed to connect to Redis'); - } - - // Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds) - $this->handler->_lifetime = 2; - } - - /** - * Callback for application getter that returns redis credentials - * - * @return mixed - */ - public function applicationGetterCallback() - { // Parse the DSN details for the test server - $dsn = defined('JTEST_CACHE_REDIS_DSN') ? JTEST_CACHE_REDIS_DSN : getenv('JTEST_CACHE_REDIS_DSN'); - $args = func_get_args(); + $dsn = defined('JTEST_CACHE_REDIS_DSN') ? JTEST_CACHE_REDIS_DSN : getenv('JTEST_CACHE_REDIS_DSN'); if ($dsn) { @@ -63,33 +38,48 @@ public function applicationGetterCallback() $dsn = substr($dsn, 6); } + // Call getConfig once to have the registry object prepared + JFactory::getConfig(); + // Split the DSN into its parts over semicolons. $parts = explode(';', $dsn); - $connection = array(); // Parse each part and populate the options array. foreach ($parts as $part) { list ($k, $v) = explode('=', $part, 2); - $connection[$k] = $v; + switch ($k) + { + case 'host': + JFactory::$config->set("redis_server_host", $v); + break; + case 'port': + JFactory::$config->set("redis_server_port", $v); + break; + case 'db': + JFactory::$config->set("redis_server_db", $v); + break; + case 'auth': + JFactory::$config->set("redis_server_auth", $v); + break; + } } + } + else + { + $this->markTestSkipped('No configuration for Redis given'); + } - switch ($args[0]) - { - case "redis_server_host": - return $connection["host"]; - break; - case "redis_server_port": - return $connection["port"]; - break; - case "redis_server_auth": - return $connection["auth"]; - break; - case "redis_server_db": - return $connection["db"]; - break; - } + try + { + $this->handler = new JCacheStorageRedis; + } + catch (JCacheExceptionConnecting $e) + { + $this->fail('Failed to connect to Redis'); } - return $args[1]; + + // Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds) + $this->handler->_lifetime = 2; } } diff --git a/travisci-phpunit.xml b/travisci-phpunit.xml deleted file mode 100644 index 36e0531c59a71..0000000000000 --- a/travisci-phpunit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - tests/unit/suites/libraries/cms - - - tests/unit/suites/libraries/joomla - - - tests/unit/suites/libraries/legacy - - - tests/unit/suites/database - - - tests/unit/suites/administrator - - - tests/unit/suites/finderIndexer - - - tests/unit/suites/plugins - - -