29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-21 03:22:52 +00:00
cms/.drone.yml

502 lines
14 KiB
YAML
Raw Normal View History

---
kind: pipeline
name: default
2019-04-28 12:41:10 +00:00
clone:
2017-02-12 13:32:55 +00:00
steps:
2022-09-15 14:06:40 +00:00
- name: setup
image: joomlaprojects/docker-images:php7.4
volumes:
- name: certificates
path: /certificates
commands:
- cp -v tests/Codeception/_data/certs/* /certificates/
- name: composer
image: joomlaprojects/docker-images:php7.4
volumes:
- name: composer-cache
path: /tmp/composer-cache
2017-02-12 10:40:56 +00:00
commands:
2019-07-15 21:11:29 +00:00
- composer validate --no-check-all --strict
2018-04-02 17:17:42 +00:00
- composer install --no-progress --no-suggest
- name: phpcs
image: joomlaprojects/docker-images:php7.2
depends_on: [ composer ]
commands:
- echo $(date)
- ./libraries/vendor/bin/php-cs-fixer fix -vvv --dry-run
2022-06-27 18:22:40 +00:00
- ./libraries/vendor/bin/phpcs --extensions=php -p --standard=ruleset.xml .
- echo $(date)
- name: phan
image: joomlaprojects/docker-images:php7.4-ast
depends_on: [ phpcs ]
failure: ignore
commands:
- ./libraries/vendor/bin/phan
- name: npm
image: node:16-bullseye-slim
depends_on: [ phpcs ]
volumes:
- name: npm-cache
path: /tmp/npm-cache
environment:
npm_config_cache: /tmp/npm-cache
commands:
2019-07-15 21:11:29 +00:00
- npm ci --unsafe-perm
2019-05-08 19:49:59 +00:00
- name: php72-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php7.2
commands:
2019-05-08 19:49:59 +00:00
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
2019-05-08 19:49:59 +00:00
- name: php73-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php7.3
commands:
2019-05-08 19:49:59 +00:00
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
2019-05-08 19:49:59 +00:00
- name: php74-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php7.4
2019-05-08 19:49:59 +00:00
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
2019-05-08 19:49:59 +00:00
- name: php80-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.0
commands:
2019-05-08 19:49:59 +00:00
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
- name: php81-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.1
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
- name: php72-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php7.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration
- name: php73-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php7.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration
- name: php74-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php7.4
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration
- name: php80-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.0
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration
- name: php81-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.1
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration
2021-12-28 14:13:29 +00:00
- name: php82-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration
- name: php72-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php7.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist
- name: php73-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php7.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist
- name: php74-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php7.4
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist
- name: php80-integration-pgsql
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.0
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-pgsql.xml.dist
- 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
2021-12-28 14:13:29 +00:00
- 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
2020-07-26 23:12:29 +00:00
- name: scss-cs
depends_on: [ npm ]
image: node:current-alpine
commands:
2020-10-19 09:16:13 +00:00
- npm run lint:css
2020-07-26 23:12:29 +00:00
- name: javascript-cs
depends_on: [ npm ]
2020-07-26 23:03:33 +00:00
image: node:current-alpine
commands:
2020-10-19 09:16:13 +00:00
- npm run lint:js
2018-04-01 13:31:04 +00:00
- name: prepare_system_tests
depends_on:
- npm
image: joomlaprojects/docker-images:systemtests
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
commands:
- sed -i 's/tests\\/Codeception\\/_output/\\/drone\\/src\\/tests\\/cypress\\/output/' codeception.yml
- php libraries/vendor/bin/codecept build
- npx cypress install
- npx cypress verify
- name: phpmin-api-mysql
depends_on:
- prepare_system_tests
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
[4.3] Add a CLI installation for Joomla (#38325) * Initial code for a CLI installation * First PoC * Lots of cleanup * Finalising CLI installer * Deleting install folder after installation * Codestyle * Fixing path of API test install * Update installation/INSTALL Co-authored-by: Brian Teeman <brian@teeman.net> * Codestyle * Docblocks * Wording * Fixing db prefix for API tests * Fixing Postgres API tests * Further fixes to API tests * Some cleanup * Fixing API tests one last time * Docblock formatting * Resorting fields * Improving progress indicator messages * Disable remote DB check for CLI installation * Fixing check * Introducing _JCLI_INSTALLATION constant for DB check * Hiding password entries on CLI * hide admin psw * show db_prefix show db_prefix in interacting mode too * Adding check for configuration.php present * Allowing for empty db password * Deleting installation folder only when not in dev mode * Codestyle * Converting strings to ini file * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/src/Console/InstallCommand.php Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/src/Console/InstallCommand.php Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/src/Console/InstallCommand.php Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/src/Console/InstallCommand.php Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/src/Console/InstallCommand.php Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/INSTALL Co-authored-by: Brian Teeman <brian@teeman.net> * Further bugfixes * Cleaning up available RDBMS options * Catching error when connecting to database * Removing false db type * Fixing case of attribute * Removing unnecessary methods from CliInstallationApplication * Fixing string * Sorting translation strings for CLI and adding shortened error message * Fixing docblocks and use statement * Adding Allons suggestions * Fixing use statements * Using language object from app * Remove unnecessary method * Fixing language object * Removing . at the end of sentences since they are followed by a : anyway * Use - instead of _ in the parameters * Fixing api tests Co-authored-by: Brian Teeman <brian@teeman.net> Co-authored-by: Nicola Galgano <optimus4joomla@gmail.com> Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>
2022-10-21 14:26:07 +00:00
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysql mysqli mysql jos_
- name: phpmin-api-postgres
depends_on:
- prepare_system_tests
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgres pgsql postgres jos_
2021-12-28 14:13:29 +00:00
- name: phpmax-api-mysql
depends_on:
- phpmin-api-mysql
- phpmin-api-postgres
image: joomlaprojects/docker-images:systemtests8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpmax mysqli mysql phpmax_
- name: phpmax-api-postgres
depends_on:
- phpmin-api-mysql
- phpmin-api-postgres
image: joomlaprojects/docker-images:systemtests8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
[4.3] Add a CLI installation for Joomla (#38325) * Initial code for a CLI installation * First PoC * Lots of cleanup * Finalising CLI installer * Deleting install folder after installation * Codestyle * Fixing path of API test install * Update installation/INSTALL Co-authored-by: Brian Teeman <brian@teeman.net> * Codestyle * Docblocks * Wording * Fixing db prefix for API tests * Fixing Postgres API tests * Further fixes to API tests * Some cleanup * Fixing API tests one last time * Docblock formatting * Resorting fields * Improving progress indicator messages * Disable remote DB check for CLI installation * Fixing check * Introducing _JCLI_INSTALLATION constant for DB check * Hiding password entries on CLI * hide admin psw * show db_prefix show db_prefix in interacting mode too * Adding check for configuration.php present * Allowing for empty db password * Deleting installation folder only when not in dev mode * Codestyle * Converting strings to ini file * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/src/Console/InstallCommand.php Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/src/Console/InstallCommand.php Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/src/Console/InstallCommand.php Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/src/Console/InstallCommand.php Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/src/Console/InstallCommand.php Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/language/en-GB/joomla.cli.ini Co-authored-by: Brian Teeman <brian@teeman.net> * Update installation/INSTALL Co-authored-by: Brian Teeman <brian@teeman.net> * Further bugfixes * Cleaning up available RDBMS options * Catching error when connecting to database * Removing false db type * Fixing case of attribute * Removing unnecessary methods from CliInstallationApplication * Fixing string * Sorting translation strings for CLI and adding shortened error message * Fixing docblocks and use statement * Adding Allons suggestions * Fixing use statements * Using language object from app * Remove unnecessary method * Fixing language object * Removing . at the end of sentences since they are followed by a : anyway * Use - instead of _ in the parameters * Fixing api tests Co-authored-by: Brian Teeman <brian@teeman.net> Co-authored-by: Nicola Galgano <optimus4joomla@gmail.com> Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>
2022-10-21 14:26:07 +00:00
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpmax pgsql postgres phpmax_
- name: phpmin-system-mysql
depends_on:
- phpmax-api-mysql
- phpmax-api-postgres
image: joomlaprojects/docker-images:cypress
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql mysqli mysql
- name: phpmin-system-postgres
depends_on:
- phpmax-api-mysql
- phpmax-api-postgres
image: joomlaprojects/docker-images:cypress
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgres pgsql postgres
2021-12-28 14:13:29 +00:00
- name: phpmax-system-mysql
depends_on:
- phpmin-system-mysql
- phpmin-system-postgres
image: joomlaprojects/docker-images:cypress8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysqlmax mysqli mysql
2021-12-28 14:13:29 +00:00
- name: phpmax-system-postgres
depends_on:
- phpmin-system-mysql
- phpmin-system-postgres
image: joomlaprojects/docker-images:cypress8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgresmax pgsql postgres
- name: phpmin-system-mysql8
depends_on:
- phpmax-system-mysql
- phpmax-system-postgres
image: joomlaprojects/docker-images:cypress
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql8 mysqli mysql8
- name: phpmax-system-mysql8
depends_on:
- phpmin-system-mysql8
image: joomlaprojects/docker-images:cypress8.1
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql8max mysqli mysql8
- name: artifacts-system-tests
image: joomlaprojects/docker-images:packager
depends_on:
- phpmax-system-mysql
- phpmax-system-mysql8
- phpmax-system-postgres
- phpmin-system-mysql
- phpmin-system-mysql8
- phpmin-system-postgres
- phpmax-api-mysql
- phpmax-api-postgres
- phpmin-api-mysql
- phpmin-api-postgres
environment:
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
GITHUB_TOKEN:
from_secret: github_token
commands:
- export PLUGIN_DEST_DIR=/artifacts/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- echo https://ci.joomla.org$PLUGIN_DEST_DIR
- rclone config create artifacts ftp host ci.joomla.org user $FTP_USERNAME port 21 pass $FTP_PASSWORD
- rclone mkdir artifacts:$PLUGIN_DEST_DIR
- rclone copy tests/cypress/output/ artifacts:$PLUGIN_DEST_DIR
- '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://ci.joomla.org$PLUGIN_DEST_DIR\"}" > /dev/null'
when:
status:
- failure
2019-03-07 18:16:06 +00:00
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
2022-09-15 14:06:40 +00:00
- name: certificates
host:
path: /tmp/certificates
services:
- name: mysql
image: mysql:5.7
environment:
MYSQL_USER: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
2018-04-05 05:53:49 +00:00
MYSQL_DATABASE: test_joomla
- name: mysql8
image: mysql:8
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:11-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
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
2020-05-11 18:47:19 +00:00
volumes:
- name: reference
path: /reference
when:
branch:
- 4.3-dev
---
kind: pipeline
name: nightly_build
steps:
- name: prepare
image: joomlaprojects/docker-images:packager
commands:
- export MINORVERSION=${DRONE_BRANCH%-*}
- composer --version
- mkdir -p transfer
- date +%s > transfer/$MINORVERSION-time.txt
- git rev-parse origin/$MINORVERSION-dev > transfer/$MINORVERSION.txt
- php build/build.php --remote=origin/$MINORVERSION-dev --exclude-gzip --exclude-bzip2
- mv build/tmp/packages/* transfer/
- name: upload
image: joomlaprojects/docker-images:packager
environment:
nightly_key:
from_secret: nightly_key
nightly_user:
from_secret: nightly_user
nightly_host:
from_secret: nightly_host
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
commands:
- export MINORVERSION=${DRONE_BRANCH%-*}
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$nightly_key" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create nightly sftp host $nightly_host user $nightly_user port 22
- rclone delete nightly:/home/devj/public_html/nightlies/ --include "Joomla_$MINORVERSION.*"
- rclone delete nightly:/home/devj/public_html/cache/com_content/
- rclone copy ./transfer/ nightly:/home/devj/public_html/nightlies/
- /bin/notify
- name: buildfailure
image: joomlaprojects/docker-images:packager
environment:
RINGCENTRAL_WEBHOOK:
from_secret: notification_url
commands:
- /bin/notify
when:
status:
- failure
trigger:
event:
- cron
- custom
repo:
- joomla/joomla-cms
---
kind: signature
2023-01-31 10:21:20 +00:00
hmac: 40893a317d8211d136371732e87096bc8015d0aff3ff849863ebe2ce00772a3d
...