Skip to content

Commit

Permalink
Merge pull request #175 from iyzoer/master
Browse files Browse the repository at this point in the history
Update travis configuration, deployment to Github releases
  • Loading branch information
gwinn authored Feb 19, 2020
2 parents 9d90c32 + d7221ec commit 24cc5e5
Show file tree
Hide file tree
Showing 20 changed files with 160 additions and 3,258 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
/vendor
/www
/bin
.env
tests/.env
86 changes: 62 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ dist: trusty

sudo: false

php:
- 7.0
- 7.1
if: tag IS blank

env:
global:
Expand All @@ -21,24 +19,64 @@ env:
- SERVER_PORT=8000
- SERVER_URL=http://localhost

before_script:
# Change MySQL root password
- echo "USE mysql;\nUPDATE user SET password=PASSWORD('root') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root

- composer install
- composer setup
- bin/robo project:deploy
- (php -S localhost:8000 -t www &) 2> /dev/null > /dev/null
- sleep 2

script:
- composer test

deploy:
skip_cleanup: true
provider: script
script: make
on:
php: 7.1
branch: master
condition: "$DEPLOY = true"
stages:
- test
- deploy

before_install:
- export LAST_TAG=`git describe --abbrev=0 --tags`
- export CURRENT_VERSION=v`cat VERSION`

before_script: make before_script

script: composer test

after_success:
- make coverage
- bash <(curl -s https://codecov.io/bash)

jobs:
include:
- php: 7.0
env:
- TEST_SUITE=2.3
- OPENCART=2.3
- php: 7.1
env:
- TEST_SUITE=2.3
- OPENCART=2.3
- php: 7.0
env:
- TEST_SUITE=3.0
- OPENCART=3.0
- php: 7.1
env:
- TEST_SUITE=3.0
- OPENCART=3.0
- php: 7.2
env:
- TEST_SUITE=3.0
- OPENCART=3.0
- php: 7.3
env:
- TEST_SUITE=3.0
- OPENCART=3.0
- stage: deploy
before_script: skip
script: make build_archive
before_deploy:
- export VERSION=`cat VERSION`
- export ARCHIVE_NAME=/tmp/retailcrm-$VERSION.ocmod.zip
- git config --local user.name "retailCRM"
- git config --local user.email "[email protected]"
- export TRAVIS_TAG=v$VERSION
- git tag $TRAVIS_TAG
deploy:
provider: releases
api_key: $GITHUB_OAUTH_TOKEN
skip_cleanup: true
file: $ARCHIVE_NAME
on:
condition: "$LAST_TAG != $CURRENT_VERSION"
if: branch = master AND type = push AND fork = false
after_deploy: make delete_archive
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v.3.3.7
* Изменена конфигурация travis-ci для сборки и развертывания

## v.3.3.6
* Небольшие фиксы

Expand Down
18 changes: 16 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FILE = $(TRAVIS_BUILD_DIR)/VERSION
VERSION = `cat $(FILE)`
ARCHIVE_NAME = '/tmp/retailcrm-'$(VERSION)'.zip'
ARCHIVE_NAME = '/tmp/retailcrm-'$(VERSION)'.ocmod.zip'

all: build_archive send_to_ftp delete_archive

Expand All @@ -11,4 +11,18 @@ send_to_ftp:
curl -T $(ARCHIVE_NAME) -u $(FTP_USER):$(FTP_PASSWORD) ftp://$(FTP_HOST)

delete_archive:
rm -f $(ARCHIVE_NAME)
rm -f $(ARCHIVE_NAME)

before_script:
mkdir coverage
# Change MySQL root password
echo "USE mysql;\nUPDATE user SET password=PASSWORD('root') WHERE user='root';\nFLUSH PRIVILEGES;\n" | mysql -u root
composer require --dev beyondit/opencart-test-suite ~$(TEST_SUITE)
composer require --dev opencart/opencart ~$(OPENCART)
composer setup
bin/robo --load-from tests/RoboFile.php project:deploy
(php -S localhost:8000 -t www &) 2> /dev/null > /dev/null
sleep 2

coverage:
wget https://phar.phpunit.de/phpcov-2.0.2.phar && php phpcov-2.0.2.phar merge coverage/ --clover coverage.xml
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.5
3.3.7
17 changes: 6 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@
"email": "[email protected]"
}
],
"require-dev": {
"opencart/opencart" : "2.3.0.2",
"vlucas/phpdotenv": "~1.1.0",
"phpunit/phpunit" : "~4.0",
"beyondit/opencart-test-suite": "~2.3.0",
"consolidation/robo": "~1",
"henrikbjorn/lurker": "^1.2"
},
"config": {
"bin-dir": "bin/",
"preferred-install": "source"
Expand All @@ -25,12 +17,15 @@
"opencart-dir" : "www"
},
"scripts" : {
"test-admin": "bin/phpunit --testsuite admin-tests --colors=always",
"test-catalog": "bin/phpunit --testsuite catalog-tests --colors=always",
"test-admin": "bin/phpunit --coverage-php coverage/admin.cov --testsuite admin-tests --colors=always",
"test-catalog": "bin/phpunit --coverage-php coverage/catalog.cov --testsuite catalog-tests --colors=always",
"test": [
"@test-admin",
"@test-catalog"
],
"setup" : "bin/robo opencart:setup"
"setup" : "bin/robo --load-from tests/RoboFile.php opencart:setup"
},
"require-dev": {
"consolidation/robo": "~1.0"
}
}
Loading

0 comments on commit 24cc5e5

Please sign in to comment.