Skip to content
Snippets Groups Projects
Commit 47002e10 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

Common files

parents
No related branches found
No related tags found
No related merge requests found
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
[*.yml]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
\ No newline at end of file
/vendor/
.idea
\ No newline at end of file
variables:
WPDESK_CI_VERSION: 1.10.19
MYSQL_ROOT_PASSWORD: mysql
MYSQL_DATABASE: wptest
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
MYSQL_INNODB_LOG_BUFFER_SIZE: 32M
PHP_ERROR_REPORTING: E_ALL
COMPOSER_ALLOW_SUPERUSER: 1
GIT_STRATEGY: fetch
ACCEPTANCE_ERROR_PATH: ${CI_PROJECT_DIR}/acceptance
stages:
- tools
- tests
- pre-deploy
- deploy
.template: &job-test-template
stage: tests
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
.template: &job-test-integration-template
<<: *job-test-template
services:
- mysql:5.6
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- composer update --no-progress
- if [[ -f tests/integration/prepare.sh ]]; then sh tests/integration/prepare.sh; fi
- vendor/bin/phpunit --configuration phpunit-integration.xml --coverage-text --colors=never
only:
- tags
.template: &job-test-integration-template-fast
<<: *job-test-integration-template
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- composer update --no-progress
- if [[ -f tests/integration/prepare.sh ]]; then sh tests/integration/prepare.sh; fi
- vendor/bin/phpunit --configuration phpunit-integration.xml --no-coverage
except:
- tags
only:
.template: &job-test-unit-template
<<: *job-test-template
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- composer update --no-progress
- vendor/bin/phpunit --configuration phpunit-unit.xml --coverage-text --colors=never
only:
- tags
.template: &job-test-unit-template-fast
<<: *job-test-unit-template
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- php --version
- cat /tmp/wordpress-develop/src/wp-includes/version.php
- cat /tmp/woocommerce/woocommerce.php
- composer update --no-progress
- vendor/bin/phpunit --configuration phpunit-unit.xml --no-coverage
except:
- tags
only:
.template: &job-deploy-template
image: wpdesknet/amazon-svn-deploy
stage: deploy
dependencies:
- build to deploy
- unit test lastest coverage
- integration test lastest coverage
retry: 2
when: manual
only:
- tags
before_script:
- cd ${CI_PROJECT_DIR}
phpmetric metrics:
stage: tools
image: wpdesknet/phpunit-woocommerce:0-0
allow_failure: true
when: manual
artifacts:
when: always
expire_in: 1 month
name: "metrics"
paths:
- ${CI_PROJECT_DIR}/phpmetric
script:
- echo ${WPDESK_CI_VERSION}
- composer require phpmetrics/phpmetrics
- composer update --no-progress
- php ./vendor/bin/phpmetrics --report-html=phpmetric .
churn metrics:
stage: tools
image: wpdesknet/phpunit-woocommerce:0-0
allow_failure: true
when: manual
script:
- echo ${WPDESK_CI_VERSION}
- composer require bmitch/churn-php
- composer update --no-progress
- vendor/bin/churn run classes inc
#code style test:
# stage: tests
# image: wpdesknet/phpunit-woocommerce:0-0
# allow_failure: true
# script:
# - echo ${WPDESK_CI_VERSION}
# - composer update --no-progress
# - vendor/bin/phpcs
unit test lastest:
<<: *job-test-unit-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
integration test lastest:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
unit test lastest coverage:
<<: *job-test-unit-template
image: wpdesknet/phpunit-woocommerce:0-0
integration test lastest coverage:
<<: *job-test-integration-template
image: wpdesknet/phpunit-woocommerce:0-0
integration test php7-1 wc-1:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:1-1
integration test php7 wc-2:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:2-2
integration test php-7 wc-3:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:2-3
integration test php5-6:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:3-0
integration test php5-5:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:4-0
integration test current woocommerce:
<<: *job-test-integration-template-fast
image: wpdesknet/phpunit-woocommerce:0-0
allow_failure: true
before_script:
- cd /tmp
- rm -rf woocommerce
- git clone https://github.com/woocommerce/woocommerce.git
- cd ${CI_PROJECT_DIR}
acceptance test:
image: wpdesknet/node
variables:
CI_DEBUG_SERVICES: trace
services:
- name: mysql:5.6
alias: mysqltests
- name: wpdesknet/apache-woocommerce:latest
alias: wootests
- name: selenium/standalone-chrome
alias: selenium
artifacts:
when: always
expire_in: 1 day
name: "error logs"
paths:
- ${CI_PROJECT_DIR}/acceptance
stage: tests
allow_failure: true
script:
- cd ${CI_PROJECT_DIR}
- composer update --no-progress --no-dev
- if [[ -f ${CI_PROJECT_DIR}/tests/acceptance/prepare.sh ]]; then sh ${CI_PROJECT_DIR}/tests/acceptance/prepare.sh; fi
- export MYSQL_IP=$(awk '/^[[:space:]]*($|#)/{next} /mysqltests/{print $1; exit}' /etc/hosts)
- export WOOTESTS_IP=$(awk '/^[[:space:]]*($|#)/{next} /wootests/{print $1; exit}' /etc/hosts)
- echo "http://wootests/wpdesk_init.php?mysql_ip=${MYSQL_IP}&wootests_ip=${WOOTESTS_IP}"
- wget -O /tmp/wpdesk_init.txt "http://wootests/wpdesk_init.php?mysql_ip=${MYSQL_IP}&wootests_ip=${WOOTESTS_IP}"
- tail -50 /tmp/wpdesk_init.txt
- sh /tmp/clone.sh git@gitlab.com:wpdesk/plugins-tests.git /tmp/tests headless
- cd /tmp/tests
- npm install
- npm install -g grunt-cli
- cd node_modules/.bin
- ./webdriver-manager update
- cd ../
- mkdir -p ${CI_PROJECT_DIR}/acceptance/reports/html/screenshot
- grunt chrome-${CI_PROJECT_NAME}
apigen docs:
image:
name: wpdesknet/apigen
stage: pre-deploy
artifacts:
expire_in: 1 day
name: "docs"
paths:
- docs/
script:
- echo ${WPDESK_CI_VERSION}
- ls -l
- /app/vendor/bin/apigen generate
- php /app/hooks-docs.php ${CI_PROJECT_DIR}
only:
- tags
pages:
stage: deploy
dependencies:
- apigen docs
script:
- rm -rf public
- mv docs/ public/
- 'curl -X POST --data-urlencode "payload={\"text\": \"Dokumentacja projektu ${CI_PROJECT_NAME} w wersji ${CI_COMMIT_REF_NAME} umieszczona w <https://gitlab.com/wpdesk/${CI_PROJECT_NAME}/pages|pages> \", }" https://hooks.slack.com/services/${SLACK_AUTH}'
artifacts:
expire_in: 1 day
paths:
- public
only:
- tags
build to deploy:
image: wpdesknet/phpunit-woocommerce:4-0
stage: pre-deploy
artifacts:
expire_in: 1 month
name: "production release"
paths:
- release
- release.zip
script:
- echo ${WPDESK_CI_VERSION}
- php --version
- ls -l
- /tmp/set_version.sh ${CI_COMMIT_REF_NAME}
- rm -rf ${CI_PROJECT_DIR}/release ${CI_PROJECT_DIR}/release.zip /tmp/release
- mkdir /tmp/release
- mkdir -p ${CI_PROJECT_DIR}/release/${CI_PROJECT_NAME}
- cp -rf ${CI_PROJECT_DIR}/* /tmp/release
- cp -rf /tmp/release/* ${CI_PROJECT_DIR}/release/${CI_PROJECT_NAME}
- cd ${CI_PROJECT_DIR}/release/${CI_PROJECT_NAME}
- composer install --no-dev --no-progress --optimize-autoloader
- rm -rf build-coverage release tests docs .git .editorconfig .gitignore .gitlab-ci.yml apigen.neon phpunit.xml acceptance test_soap.php .gitlab
- rm -rf composer.json composer.lock phpcs.xml.dist phpunit-integration.xml phpunit-unit.xml composer.phar wp-cli.phar
- cd ../
- zip -r -q ../release.zip ./
only:
- tags
deploy to shop:
<<: *job-deploy-template
script:
- echo ${WPDESK_CI_VERSION}
- /tmp/deploy_shop.sh ${CI_PROJECT_NAME} release.zip ${CI_PROJECT_NAME}.zip
- 'curl -X POST --data-urlencode "payload={\"text\": \"Projekt <https://gitlab.com/wpdesk/${CI_PROJECT_NAME}|${CI_PROJECT_NAME}> zdeployowany do sklepu w wersji ${CI_COMMIT_REF_NAME}\", }" https://hooks.slack.com/services/${SLACK_AUTH}'
environment:
name: wpdesk shop
url: https://wpdeskplugin.s3.amazonaws.com/${CI_PROJECT_NAME}.zip
deploy to demo:
<<: *job-deploy-template
script:
- echo ${WPDESK_CI_VERSION}
- /tmp/deploy_demo.sh release/${CI_PROJECT_NAME} ${CI_PROJECT_NAME}
- 'curl -X POST --data-urlencode "payload={\"text\": \"Projekt <https://gitlab.com/wpdesk/${CI_PROJECT_NAME}|${CI_PROJECT_NAME}> zdeployowany do demo w wersji ${CI_COMMIT_REF_NAME}\", }" https://hooks.slack.com/services/${SLACK_AUTH}'
environment:
name: wpdesk demo
url: https://demo.wpdesk.org
deploy to repository:
<<: *job-deploy-template
script:
- echo ${WPDESK_CI_VERSION}
- rm -rf /tmp/svn-repository
- mkdir /tmp/svn-repository
- /tmp/deploy_repository.sh ${CI_PROJECT_NAME} ${CI_PROJECT_DIR}/release/${CI_PROJECT_NAME} /tmp/svn-repository
- 'curl -X POST --data-urlencode "payload={\"text\": \"Projekt <https://gitlab.com/wpdesk/${CI_PROJECT_NAME}|${CI_PROJECT_NAME}> zdeployowany do repozytorium WP w wersji ${CI_COMMIT_REF_NAME}\", }" https://hooks.slack.com/services/${SLACK_AUTH}'
environment:
name: wordpress repository
url: https://downloads.wordpress.org/plugin/${CI_PROJECT_NAME}.${CI_COMMIT_REF_NAME}.zip
LICENSE 0 → 100644
MIT License
Copyright (c) 2018 WP Desk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
destination: docs
templateConfig: /app/theme-woocommerce/config.neon
extensions: [php]
source:
- classes
exclude:
- vendor
- tests
- languages
charset: [UTF-8]
main: Wordpress plugin
title: Plugin template more info
baseUrl: "/"
templateTheme: default
php: false
sourceCode: false
tree: true
deprecated: false
todo: false
download: false
accessLevels:
- public
- private
- protected
\ No newline at end of file
{
"name": "wpdesk/wp-builder",
"authors": [
{
"name": "Krzysiek",
"email": "krzysiek@wpdesk.pl"
}
],
"require": {
"php": ">=5.5",
"wpdesk/wp-basic-requirements": "dev-master"
},
"require-dev": {
"phpunit/phpunit": "<7",
"wp-coding-standards/wpcs": "^0.14.1",
"squizlabs/php_codesniffer": "^3.0.2",
"mockery/mockery": "*",
"10up/wp_mock": "*",
"wimg/php-compatibility": "^8"
},
"autoload": {
"psr-4": {"WPDesk\\PluginBuilder\\": "src/"}
},
"autoload-dev": {
},
"scripts": {
"phpcs": "phpcs",
"phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
"phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
"phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
"phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage"
}
}
<?xml version="1.0"?>
<ruleset name="WordPress Coding Standards for WP Desk Plugin">
<description>Sniffs for WordPress WPDesk plugins</description>
<config name="installed_paths" value="vendor/wp-coding-standards/wpcs,vendor/wimg/php-compatibility" />
<rule ref="PHPCompatibility"/>
<config name="testVersion" value="5.5-"/>
<rule ref="WordPress"/>
<config name="text_domain" value="wpdesk-plugin,default,s214-settings-demo"/>
<arg name="extensions" value="php"/>
<file>./classes</file>
<exclude-pattern>*/settings-api/*</exclude-pattern>
</ruleset>
<phpunit bootstrap="tests/integration/bootstrap.php"
backupGlobals="false"
>
<testsuites>
<testsuite>
<directory prefix="test-" suffix=".php">./tests/integration</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">classes</directory>
</whitelist>
</filter>
<logging>
<log type="junit" target="build-coverage/report.junit.xml"/>
<log type="coverage-html" target="build-coverage/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build-coverage/coverage.txt"/>
<log type="coverage-clover" target="build-coverage/clover.xml"/>
</logging>
<php>
<env name="WP_DEVELOP_DIR" value="/tmp/wordpress-develop"/>
<env name="WC_DEVELOP_DIR" value="/tmp/woocommerce"/>
</php>
</phpunit>
\ No newline at end of file
<phpunit bootstrap="tests/unit/bootstrap.php">
<testsuites>
<testsuite>
<directory prefix="test-" suffix=".php">./tests/unit/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">classes</directory>
</whitelist>
</filter>
<logging>
<log type="junit" target="build-coverage/report.junit.xml"/>
<log type="coverage-html" target="build-coverage/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build-coverage/coverage.txt"/>
<log type="coverage-clover" target="build-coverage/clover.xml"/>
</logging>
</phpunit>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment