cms/.drone.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

510 lines
15 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
2023-12-20 13:41:40 +00:00
image: joomlaprojects/docker-images:php8.3
2022-09-15 14:06:40 +00:00
volumes:
- name: certificates
path: /certificates
commands:
- cp -v tests/certs/* /certificates/
2022-09-15 14:06:40 +00:00
- name: composer
2023-12-20 13:41:40 +00:00
image: joomlaprojects/docker-images:php8.3
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:php8.1
depends_on: [ composer ]
commands:
- echo $(date)
- ./libraries/vendor/bin/php-cs-fixer fix -vvv --dry-run --diff
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:20-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
2023-06-22 15:33:38 +00:00
- name: php82-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
2023-12-20 13:41:40 +00:00
- name: php83-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.3
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
2023-12-20 13:41:40 +00:00
- name: php83-integration
depends_on: [ npm ]
image: joomlaprojects/docker-images:php8.3
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
2023-12-20 13:41:40 +00:00
- 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
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
- npm run lint:testjs
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
environment:
CYPRESS_VERIFY_TIMEOUT: 100000
commands:
- mv cypress.config.dist.js cypress.config.js
- npx cypress install
- npx cypress verify
- name: phpmin-system-mysql
depends_on:
- prepare_system_tests
image: joomlaprojects/docker-images:cypress
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/System/drone-system-run.sh "$(pwd)" cmysql mysqli mysql
- name: phpmin-system-postgres
depends_on:
- prepare_system_tests
image: joomlaprojects/docker-images:cypress
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/System/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
2023-12-20 13:41:40 +00:00
image: joomlaprojects/docker-images:cypress8.3
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/System/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
2023-12-20 13:41:40 +00:00
image: joomlaprojects/docker-images:cypress8.3
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/System/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/System/drone-system-run.sh "$(pwd)" cmysql8 mysqli mysql8
- name: phpmax-system-mysql8
depends_on:
- phpmax-system-mysql
- phpmax-system-postgres
2023-12-20 13:41:40 +00:00
image: joomlaprojects/docker-images:cypress8.3
volumes:
- name: cypress-cache
path: /root/.cache/Cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/System/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
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
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.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: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:
HTTP_ROOT: "https://artifacts.joomla.org/drone"
DRONE_PULL_REQUEST: DRONE_PULL_REQUEST
DRONE_COMMIT: DRONE_COMMIT
commands:
2023-11-03 10:46:42 +00:00
- /bin/drone_prepare_package.sh
- name: upload
image: joomlaprojects/docker-images:packager
environment:
package_key:
from_secret: package_key
package_user:
from_secret: package_user
package_host:
from_secret: package_host
package_root:
from_secret: package_root
GITHUB_TOKEN:
from_secret: github_token
commands:
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "$package_key" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add
- rclone config create package sftp host $package_host user $package_user port 22
- rclone copy ./upload/ package:$package_root/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/downloads/$DRONE_BUILD_NUMBER
- /bin/add_github_status.sh "Download" "Prebuilt packages are available for download." "https://artifacts.joomla.org/drone/${DRONE_REPO}/${DRONE_BRANCH}/${DRONE_PULL_REQUEST}/downloads/${DRONE_BUILD_NUMBER}"
trigger:
repo:
- joomla/joomla-cms
---
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
MATTERMOST_NIGHTLY_HOOK:
from_secret: mattermost_nightly_hook
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/
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 4.4](https://developer.joomla.org/nightly-builds.html) successfully built."}' $MATTERMOST_NIGHTLY_HOOK
- name: buildfailure
image: joomlaprojects/docker-images:packager
environment:
MATTERMOST_NIGHTLY_HOOK:
from_secret: mattermost_nightly_hook
commands:
- curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 4.4](https://developer.joomla.org/nightly-builds.html) FAILED to built."}' $MATTERMOST_NIGHTLY_HOOK
when:
status:
- failure
trigger:
event:
- cron
- custom
repo:
- joomla/joomla-cms
---
kind: signature
hmac: 4883ca31950b6197886ad6e53fa6ec4bd19152852ea3e016a95a27b7ff27eece
...