Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
313 changes: 1 addition & 312 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,314 +1,3 @@
---
kind: pipeline
name: default

clone:

steps:
- name: setup
image: joomlaprojects/docker-images:php8.4
volumes:
- name: certificates
path: /certificates
commands:
- cp -v tests/certs/* /certificates/

- name: composer
image: joomlaprojects/docker-images:php8.4
volumes:
- name: composer-cache
path: /tmp/composer-cache
commands:
- composer validate --no-check-all --strict
- composer install --no-progress --ignore-platform-reqs

- name: phpcs
image: joomlaprojects/docker-images:php8.1
depends_on: [ composer ]
commands:
- echo $(date)
- ./libraries/vendor/bin/php-cs-fixer fix -vvv --dry-run --diff
- ./libraries/vendor/bin/phpcs --extensions=php -p --standard=ruleset.xml .
- echo $(date)

- name: phpstan
image: joomlaprojects/docker-images:php8.2
depends_on: [ phpcs ]
commands:
- ./libraries/vendor/bin/phpstan

- name: npm
image: node:20-bullseye-slim
depends_on: [ phpcs ]
volumes:
- name: npm-cache
path: /tmp/npm-cache
environment:
npm_config_cache: /tmp/npm-cache
commands:
- npm ci --unsafe-perm

- name: php81-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.1
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit

- name: php82-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit

- name: php83-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit

- name: php84-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.4
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit

- name: php81-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.1
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration

- name: php82-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration

- name: php83-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration

- name: php84-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.4
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration

- name: php81-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.1
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist

- name: php82-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist

- name: php83-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist

- name: php84-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.4
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist

- name: scss-cs
depends_on: [ npm ]
image: node:current-alpine
commands:
- npm run lint:css

- name: javascript-cs
depends_on: [ npm ]
image: node:current-alpine
commands:
- npm run lint:js
- npm run lint:testjs

- name: prepare_system_tests
depends_on:
- npm
image: joomlaprojects/docker-images:cypress8.4
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
CYPRESS_VERIFY_TIMEOUT: 100000
commands:
- cp cypress.config.dist.mjs cypress.config.mjs
- npx cypress install
- npx cypress verify

- name: phpmin-system-mysql
depends_on:
- prepare_system_tests
image: joomlaprojects/docker-images:cypress8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/System/entrypoint.sh "$(pwd)" cmysql mysqli mysql

- name: phpmax-system-mysql
depends_on:
- phpmin-system-mysql
image: joomlaprojects/docker-images:cypress8.4
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/System/entrypoint.sh "$(pwd)" cmysqlmax mysqli mysql
when:
event:
exclude:
- pull_request


- name: phpmin-system-postgres
depends_on:
- prepare_system_tests
image: joomlaprojects/docker-images:cypress8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/System/entrypoint.sh "$(pwd)" cpostgres pgsql postgres
when:
event:
exclude:
- pull_request

- name: phpmax-system-postgres
depends_on:
- phpmin-system-postgres
image: joomlaprojects/docker-images:cypress8.4
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/System/entrypoint.sh "$(pwd)" cpostgresmax pgsql postgres

- name: artifacts-system-tests
image: joomlaprojects/docker-images:packager
depends_on:
- phpmax-system-mysql
- phpmax-system-postgres
- phpmin-system-mysql
- phpmin-system-postgres
environment:
WEB_SERVER:
from_secret: webserver
FTP_KEY:
from_secret: ftp_key
FTP_USER:
from_secret: ftp_user
FTP_HOST:
from_secret: ftp_host
ARTIFACTS_ROOT:
from_secret: artifacts_root
GITHUB_TOKEN:
from_secret: github_token
commands:
- export PLUGIN_DEST_DIR=$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- echo https://$WEB_SERVER/drone/$PLUGIN_DEST_DIR
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$FTP_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create artifacts sftp host $FTP_HOST user $FTP_USER port 22
- rclone mkdir artifacts:$ARTIFACTS_ROOT/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- rclone copy tests/System/output/ artifacts:$ARTIFACTS_ROOT/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- 'curl -X POST "https://api.github.com/repos/$DRONE_REPO/statuses/$DRONE_COMMIT" -H "Content-Type: application/json" -H "Authorization: token $GITHUB_TOKEN" -d "{\"state\":\"failure\", \"context\": \"Artifacts from Failure\", \"description\": \"You can find artifacts from the failure of the build here:\", \"target_url\": \"https://$WEB_SERVER/drone/$PLUGIN_DEST_DIR\"}" > /dev/null'
when:
status:
- failure

volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
- name: cypress-cache
host:
path: /tmp/cypress-cache
- name: npm-cache
host:
path: /tmp/npm-cache
- name: certificates
host:
path: /tmp/certificates

services:
- name: mysql
image: mysql:8.0
command: ["--default-authentication-plugin=mysql_native_password"]
environment:
MYSQL_USER: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_DATABASE: test_joomla

- name: postgres
image: postgres:12-alpine
ports:
- 5432
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: joomla_ut
POSTGRES_DB: test_joomla

- name: openldap
image: bitnami/openldap:latest
ports:
- 1389
- 1636
volumes:
- name: certificates
path: /certificates
environment:
LDAP_ADMIN_USERNAME: admin
LDAP_ADMIN_PASSWORD: adminpassword
LDAP_USERS: customuser
LDAP_PASSWORDS: custompassword
LDAP_ENABLE_TLS: yes
LDAP_TLS_CERT_FILE: /certificates/openldap.crt
LDAP_TLS_KEY_FILE: /certificates/openldap.key
LDAP_TLS_CA_FILE: /certificates/CA.crt
BITNAMI_DEBUG: true
LDAP_CONFIG_ADMIN_ENABLED: yes
LDAP_CONFIG_ADMIN_USERNAME: admin
LDAP_CONFIG_ADMIN_PASSWORD: configpassword

---
kind: pipeline
name: package

Expand Down Expand Up @@ -414,6 +103,6 @@ trigger:

---
kind: signature
hmac: e7e97cddd98bd4db561056d6eb59c5eea2ae3fd55e20870bf800beaa773fbf6b
hmac: 8c9f8d28fda74e2a6fc508602dd07e9af7d9f4a5a13af769c6a53e6bd6e91389

...