cms/.drone.yml

530 lines
15 KiB
YAML

---
kind: pipeline
name: default
clone:
steps:
- name: setup
image: joomlaprojects/docker-images:php7.4
volumes:
- name: certificates
path: /certificates
commands:
- cp -v tests/Codeception/_data/certs/* /certificates/
- name: openldap
image: bitnami/openldap:latest
detach: true
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
- name: composer
image: joomlaprojects/docker-images:php7.4
volumes:
- name: composer-cache
path: /tmp/composer-cache
commands:
- composer validate --no-check-all --strict
- composer install --no-progress --no-suggest
- name: phpcs
image: joomlaprojects/docker-images:php7.2
depends_on: [ composer ]
commands:
- echo $(date)
- ./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:
- npm ci --unsafe-perm
- name: php72-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php7.2
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
- name: php73-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php7.3
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
- name: php74-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php7.4
commands:
- php -v
- ./libraries/vendor/bin/phpunit --testsuite Unit
- name: php80-unit
depends_on: [ phpcs ]
image: joomlaprojects/docker-images:php8.0
commands:
- 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
- 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
- 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: 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
- name: prepare_codeception_tests
depends_on:
- npm
image: joomlaprojects/docker-images:systemtests
commands:
- sed -i 's/tests\\/Codeception\\/_output/\\/drone\\/src\\/tests\\/Codeception\\/_output/' codeception.yml
- php libraries/vendor/bin/codecept build
- name: phpmin-api-mysql
depends_on:
- prepare_codeception_tests
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysql
- name: phpmax-api-mysql
depends_on:
- prepare_codeception_tests
image: joomlaprojects/docker-images:systemtests8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpmax
# - name: phpnext-api-mysql
# depends_on:
# - phpmax-api-mysql
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-api-run.sh "$(pwd)" mysqlphpnext
- name: phpmin-api-postgres
depends_on:
- prepare_codeception_tests
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgres
- name: phpmax-api-postgres
depends_on:
- prepare_codeception_tests
image: joomlaprojects/docker-images:systemtests8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpmax
# - name: phpnext-api-postgres
# depends_on:
# - phpmin-api-postgres
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-api-run.sh "$(pwd)" postgresphpnext
- name: phpmin-system-mysql
depends_on:
- phpmax-api-mysql
- phpmax-api-postgres
image: joomlaprojects/docker-images:cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql mysqli mysql
- name: phpmax-system-mysql
depends_on:
- phpmax-api-mysql
- phpmax-api-postgres
image: joomlaprojects/docker-images:cypress8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysqlmax mysqli mysql
# - name: phpnext-system-mysql
# depends_on:
# - phpmax-system-mysql
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" mysqlphpnext
- name: phpmin-system-postgres
depends_on:
- phpmax-api-mysql
- phpmax-api-postgres
image: joomlaprojects/docker-images:cypress
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgres pgsql postgres
- name: phpmax-system-postgres
depends_on:
- phpmax-api-mysql
- phpmax-api-postgres
image: joomlaprojects/docker-images:cypress8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cpostgresmax pgsql postgres
# - name: phpnext-system-postgres
# depends_on:
# - phpmax-system-postgres
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" postgresphpnext
- name: phpmin-system-mysql8
depends_on:
- phpmax-system-mysql
- phpmax-system-postgres
image: joomlaprojects/docker-images: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:
- phpmax-system-mysql
- phpmax-system-postgres
image: joomlaprojects/docker-images:cypress8.1
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/cypress/drone-system-run.sh "$(pwd)" cmysql8max mysqli mysql8
# - name: phpnext-system-mysql8
# depends_on:
# - phpmax-system-mysql8
# image: joomlaprojects/docker-images:systemtests8.2
# failure: ignore
# environment:
# JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
# commands:
# - bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql8phpnext
- name: artifacts-system-tests
image: cschlosser/drone-ftps
depends_on:
# - phpnext-system-mysql
# - phpnext-system-mysql8
# - phpnext-system-postgres
- phpmax-system-mysql
- phpmax-system-mysql8
- phpmax-system-postgres
- phpmin-system-mysql
- phpmin-system-mysql8
- phpmin-system-postgres
# - phpnext-api-mysql
# - phpnext-api-postgres
- phpmax-api-mysql
- phpmax-api-postgres
- phpmin-api-mysql
- phpmin-api-postgres
environment:
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
PLUGIN_HOSTNAME: ci.joomla.org:21
PLUGIN_SRC_DIR: /tests/cypress/output/
PLUGIN_DEST_DIR: /artifacts
PLUGIN_SECURE: false
PLUGIN_EXCLUDE: ^\.git/$
commands:
- export PLUGIN_DEST_DIR=$PLUGIN_DEST_DIR/$DRONE_REPO/$DRONE_BRANCH/$DRONE_PULL_REQUEST/system-tests/$DRONE_BUILD_NUMBER
- echo https://ci.joomla.org$PLUGIN_DEST_DIR
- /bin/upload.sh
when:
status:
- failure
volumes:
- name: composer-cache
host:
path: /tmp/composer-cache
- name: npm-cache
host:
path: /tmp/npm-cache
- 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
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
---
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
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
hmac: f496f213481b3afcec73da651fc838af21f76950954daac599e665ceb382cc2d
...