Skip to content
Snippets Groups Projects

Deployowanie

Closed Krzysztof Dyszczyk requested to merge devel-deploy into master
6 files
+ 219
2229
Compare changes
  • Side-by-side
  • Inline

Files

+ 70
20
before_script:
before_script:
- cd /builds/wpdesk/plugin-template/
- cd ${CI_PROJECT_DIR}
variables:
variables:
MYSQL_ROOT_PASSWORD: mysql
MYSQL_ROOT_PASSWORD: mysql
@@ -8,6 +8,7 @@ variables:
@@ -8,6 +8,7 @@ variables:
MYSQL_PASSWORD: mysql
MYSQL_PASSWORD: mysql
MYSQL_INNODB_LOG_BUFFER_SIZE: 32M
MYSQL_INNODB_LOG_BUFFER_SIZE: 32M
PHP_ERROR_REPORTING: E_ALL
PHP_ERROR_REPORTING: E_ALL
 
COMPOSER_ALLOW_SUPERUSER: 1
GIT_STRATEGY: fetch
GIT_STRATEGY: fetch
cache:
cache:
@@ -18,7 +19,6 @@ cache:
@@ -18,7 +19,6 @@ cache:
stages:
stages:
- build
- build
- tests
- tests
- docs
- pre-deploy
- pre-deploy
- deploy
- deploy
@@ -26,13 +26,13 @@ build php:
@@ -26,13 +26,13 @@ build php:
image: wpdesknet/phpunit-woocommerce:0-0
image: wpdesknet/phpunit-woocommerce:0-0
stage: build
stage: build
artifacts:
artifacts:
 
expire_in: 1 day
name: "dev vendor"
name: "dev vendor"
paths:
paths:
- vendor/
- vendor/
script:
script:
- wget -nc https://getcomposer.org/download/1.6.3/composer.phar
- ls /usr/local/bin
- wget -nc https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
- composer install --no-progress
- php composer.phar install --no-progress
#build js:
#build js:
# image: node:slim
# image: node:slim
@@ -71,6 +71,7 @@ integration test 0-0:
@@ -71,6 +71,7 @@ integration test 0-0:
services:
services:
- mysql
- mysql
stage: tests
stage: tests
 
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
dependencies:
dependencies:
- build php
- build php
script:
script:
@@ -82,6 +83,7 @@ integration test 1-1:
@@ -82,6 +83,7 @@ integration test 1-1:
services:
services:
- mysql
- mysql
stage: tests
stage: tests
 
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
dependencies:
dependencies:
- build php
- build php
script:
script:
@@ -93,6 +95,7 @@ integration test 2-2:
@@ -93,6 +95,7 @@ integration test 2-2:
services:
services:
- mysql
- mysql
stage: tests
stage: tests
 
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
dependencies:
dependencies:
- build php
- build php
script:
script:
@@ -104,6 +107,7 @@ integration test 3-3:
@@ -104,6 +107,7 @@ integration test 3-3:
services:
services:
- mysql
- mysql
stage: tests
stage: tests
 
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
dependencies:
dependencies:
- build php
- build php
script:
script:
@@ -115,28 +119,27 @@ integration test 4-3:
@@ -115,28 +119,27 @@ integration test 4-3:
services:
services:
- mysql
- mysql
stage: tests
stage: tests
 
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
dependencies:
dependencies:
- build php
- build php
script:
script:
- php --version
- php --version
- phpunit --configuration phpunit-integration.xml
- phpunit --configuration phpunit-integration.xml
# apigen requires PHP 7.1
apigen docs:
apigen docs:
image: wpdesknet/phpunit-woocommerce:1-0
image:
stage: docs
name: wpdesknet/apigen
dependencies:
stage: build
- build php
artifacts:
artifacts:
 
expire_in: 1 day
name: "docs"
name: "docs"
paths:
paths:
- docs/
- docs/
script:
script:
- ls -l
- ls -l
- php --version
- /app/vendor/bin/apigen generate
- php composer.phar docs
- php /app/hooks-docs.php ${CI_PROJECT_DIR}
only:
when: manual
- tags
build to deploy:
build to deploy:
image: wpdesknet/phpunit-woocommerce:0-0
image: wpdesknet/phpunit-woocommerce:0-0
@@ -144,20 +147,67 @@ build to deploy:
@@ -144,20 +147,67 @@ build to deploy:
dependencies:
dependencies:
- build php
- build php
artifacts:
artifacts:
name: "production vendor"
expire_in: 1 month
 
name: "production release"
paths:
paths:
- vendor/
- release
 
- release.zip
script:
script:
- php --version
- 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
- 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:
deploy to shop:
image: wpdesknet/phpunit-woocommerce:0-0
image: wpdesknet/amazon-svn-deploy
stage: deploy
stage: deploy
dependencies:
dependencies:
- build to deploy
- build to deploy
 
retry: 2
script:
script:
- echo void
- ls -l
 
- /tmp/deploy_shop.sh ${CI_PROJECT_NAME} release.zip ${CI_PROJECT_NAME}.zip
 
only:
 
- tags
when: manual
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:
only:
- tags
- tags
\ No newline at end of file
when: manual
 
\ No newline at end of file
Loading