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:
- 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
\ No newline at end of file
- tags
when: manual
\ No newline at end of file
Loading