Skip to content
Snippets Groups Projects
Commit 3c3021c4 authored by Krzysztof Dyszczyk's avatar Krzysztof Dyszczyk
Browse files

Seria usprawnien w testach i dokumentacji oraz wsparcie dla deployowania

wtyczek do sklepu i repo
parent f9b4055a
Branches
Tags
2 merge requests!4Seria usprawnien w testach i dokumentacji oraz wsparcie dla deployowania,!3Deployowanie
before_script:
- cd /builds/wpdesk/plugin-template/
- cd ${CI_PROJECT_DIR}
variables:
MYSQL_ROOT_PASSWORD: mysql
......@@ -8,6 +8,7 @@ variables:
MYSQL_PASSWORD: mysql
MYSQL_INNODB_LOG_BUFFER_SIZE: 32M
PHP_ERROR_REPORTING: E_ALL
COMPOSER_ALLOW_SUPERUSER: 1
GIT_STRATEGY: fetch
cache:
......@@ -18,7 +19,6 @@ cache:
stages:
- build
- tests
- docs
- pre-deploy
- deploy
......@@ -26,13 +26,13 @@ build php:
image: wpdesknet/phpunit-woocommerce:0-0
stage: build
artifacts:
expire_in: 1 day
name: "dev vendor"
paths:
- vendor/
script:
- wget -nc https://getcomposer.org/download/1.6.3/composer.phar
- wget -nc https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
- php composer.phar install --no-progress
- ls /usr/local/bin
- composer install --no-progress
#build js:
# image: node:slim
......@@ -71,6 +71,7 @@ integration test 0-0:
services:
- mysql
stage: tests
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
dependencies:
- build php
script:
......@@ -82,6 +83,7 @@ integration test 1-1:
services:
- mysql
stage: tests
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
dependencies:
- build php
script:
......@@ -93,6 +95,7 @@ integration test 2-2:
services:
- mysql
stage: tests
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
dependencies:
- build php
script:
......@@ -104,6 +107,7 @@ integration test 3-3:
services:
- mysql
stage: tests
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
dependencies:
- build php
script:
......@@ -115,28 +119,27 @@ integration test 4-3:
services:
- mysql
stage: tests
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
dependencies:
- build php
script:
- php --version
- phpunit --configuration phpunit-integration.xml
# apigen requires PHP 7.1
apigen docs:
image: wpdesknet/phpunit-woocommerce:1-0
stage: docs
dependencies:
- build php
image:
name: wpdesknet/apigen
stage: build
artifacts:
expire_in: 1 day
name: "docs"
paths:
- docs/
script:
- ls -l
- php --version
- php composer.phar docs
only:
- tags
- /app/vendor/bin/apigen generate
- php /app/hooks-docs.php ${CI_PROJECT_DIR}
when: manual
build to deploy:
image: wpdesknet/phpunit-woocommerce:0-0
......@@ -144,20 +147,67 @@ build to deploy:
dependencies:
- build php
artifacts:
name: "production vendor"
expire_in: 1 month
name: "production release"
paths:
- vendor/
- release
- release.zip
script:
- php --version
- ls -l
- rm -rf ${CI_PROJECT_DIR}/release
- rm -rf ${CI_PROJECT_DIR}/release.zip
- rm -rf /tmp/release
- mkdir /tmp/release
- mkdir ${CI_PROJECT_DIR}/release
- cp -rf ${CI_PROJECT_DIR}/* /tmp/release
- cp -rf /tmp/release/* ${CI_PROJECT_DIR}/release
- cd ${CI_PROJECT_DIR}/release
- php composer.phar install --no-dev --no-progress
- rm -rf build-coverage
- rm -rf release
- rm -rf tests
- rm -rf docs
- rm -rf .git
- rm -f .editorconfig
- rm -f .gitignore
- rm -f .gitlab-ci.yml
- rm -f apigen.neon
- rm -f composer.json
- rm -f composer.lock
- rm -f phpcs.xml.dist
- rm -f phpunit-integration.xml
- rm -f phpunit-unit.xml
- rm -f composer.phar
- rm -f wp-cli.phar
- zip -r -q ../release.zip ./
only:
- tags
deploy to void:
image: wpdesknet/phpunit-woocommerce:0-0
deploy to shop:
image: wpdesknet/amazon-svn-deploy
stage: deploy
dependencies:
- build to deploy
retry: 2
script:
- echo void
- ls -l
- /tmp/deploy_shop.sh ${CI_PROJECT_NAME} release.zip ${CI_PROJECT_NAME}.zip
only:
- tags
when: manual
deploy to repository:
image: wpdesknet/amazon-svn-deploy
stage: deploy
dependencies:
- build to deploy
retry: 2
script:
- ls -l
- rm -rf /tmp/svn-repository
- mkdir /tmp/svn-repository
- /tmp/deploy_repository.sh flexible-pdf release /tmp/svn-repository
only:
- tags
when: manual
\ No newline at end of file
......@@ -17,7 +17,7 @@ baseUrl: "/"
templateTheme: default
php: false
sourceCode: false
tree: false
tree: true
deprecated: false
todo: false
download: false
......
*** plugin-template Changelog ***
1.0.0 - 2018-03-16
* deploy test
\ No newline at end of file
......@@ -15,8 +15,7 @@
"squizlabs/php_codesniffer": "^3.0.2",
"mockery/mockery": "^1.0",
"10up/wp_mock": "^0.3",
"wimg/php-compatibility": "^8",
"apigen/apigen": "^4.1"
"wimg/php-compatibility": "^8"
},
"autoload-dev": {
"psr-4": {
......@@ -26,8 +25,8 @@
"scripts": {
"test": "echo composer is alive",
"phpcs": "phpcs",
"phpunit-unit": "phpunit --configuration phpunit-unit.xml",
"phpunit-integration": "phpunit --configuration phpunit-integration.xml",
"phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
"phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
"docs": "apigen generate"
}
}
This diff is collapsed.
......@@ -7,6 +7,12 @@
</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"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment