From a39a190f62d02909664750390999f55fc3eec26e Mon Sep 17 00:00:00 2001 From: Lauren Schaefer Date: Mon, 11 Dec 2017 13:26:44 -0500 Subject: [PATCH 1/2] Add stage to build zip and publish as GitHub release --- .travis.yml | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 63172f66..3b265193 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,32 @@ -matrix: +stages: + - name: test + - name: Build & Post on GitHub + if: branch = master +jobs: include: - - language: php - php: '7.1' - os: linux - before_script: - - composer install - - language: node_js - node_js: '9' - before_install: - - yarn global add grunt-cli - + - stage: test + language: php + php: '7.1' + os: linux + before_script: + - composer install + - stage: test + language: node_js + node_js: '9' + before_install: + - yarn global add grunt-cli + - stage: Build & Post on GitHub + language: php + php: '7.1' + before_script: + - composer install + - cd package + script: "./pack.php latest" + before_deploy: + git tag "$(date +'%Y%m%d-%H.%M.%S')-$(git log --format=%h -1)" + deploy: + provider: releases + file: releases/sugarcrm-ProfessorM-latest.zip + api_key: + secure: bM9iT8Lh06t/BKWDHZpTKrsE3UQqs1EnPWkNy6+KqXCuaECeeyw9KlvkVfhsDgXH4a9g2RvnIkXwWuueOZvLEHeAdaVxC0JpP2Zbv4kBcF8LOuRKaJVCrjcnnPGQft2F5wKdnEbXPd4ZjSK40kSk8qSp3cSjMUYrVFwcttmvTY08sbNN2Tbx/zelkTELmOKWj+1QseNr6ch7r9PrzR2GvK6p6QJUFmMXyIDywlUvCdFafjc4pikhhuTq/1gdUARyC8+pTSb70atP53PoKZtVcHXL1l+Jis7DxWAN/fVy+Fsv5yeLbXsj8M4xc5Uzy3TltAaIVLUSpOAU9KaKvJREkCy1V42ha10c5NSlkZ9jxI7XlPfiqVgKZB0bR9MAD+6sUYBF9gQvVfAJUztFCoLdPtMnmvVuhCY94t9hBc6WJbeldd6/aBy8NPAD2QZ3ZMeJ65m3PnboMPtnychhGGF+c4sU/Wmtz4ptUG0qe1ajEV/mX7chr5lWWHySdr41BwklcIm0ZSMmtI4lwZgUIMVkjowd3abWovN8OQg4i9AcvGyutfIANH+SQF357GfshzYSvUZ50E7uYeKrMjK0bqZJH/Gbw6WElQb7w88P0sCnpzb944ssXtl/zBCpW7zg6bBZCo+1E8wp8BWwqLj+li1F3Gn0kqEVoKgz+gjazkIqwmU= + skip_cleanup: true From 263464142000ff10afdc0626740ed29dbcee3c16 Mon Sep 17 00:00:00 2001 From: Lauren Schaefer Date: Fri, 22 Dec 2017 13:10:05 -0500 Subject: [PATCH 2/2] Update the readme for new travis stages --- README.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 68f39eb8..c8a59182 100755 --- a/README.md +++ b/README.md @@ -153,9 +153,32 @@ You can then click Details to open the build results in Travis CI. ### About the build -The build is configured in [.travis.yml](.travis.yml). Currently, the build runs two jobs: -- Execute the PHPUnit tests (see [PHPUnit tests](#phpunit-tests) for details) -- Execute the Jasmine tests (see [Jasmine tests](#jasmine-tests) for details) +The build is configured in [.travis.yml](.travis.yml). Currently, the build has two stages: +- test +- Build & Post on GitHub + +The test stage is run first and has two jobs: + - Execute the PHPUnit tests (see [PHPUnit tests](#phpunit-tests) for details) + - Execute the Jasmine tests (see [Jasmine tests](#jasmine-tests) for details) + +If the test stage passes and the build is being run against the master branch, the Build & Post on GitHub stage will be +kicked off. This stage executes the pack.php script to generate the Professor M module loadable package as a zip. The +zip will be automatically posted to GitHub: https://github.com/sugarcrm/school/releases. + +If you want the Build & Post on GitHub stage to be kicked off for a branch other than master, you should do **both** of +the following in [.travis.yml](.travis.yml). +- Remove the "if: branch = master" in the `stages` section +- Add the branch as an option in the deploy section. For example: +```$xslt + deploy: + provider: releases + file: releases/sugarcrm-ProfessorM-latest.zip + api_key: + secure: mykey + skip_cleanup: true + on: + branch: mybranchname +``` We hope to expand the build to do more (like deploy Sugar) in the future.