Skip to content

Commit

Permalink
Merge pull request #7 from sugarcrm/buildartifacts
Browse files Browse the repository at this point in the history
Add stage to build zip and publish as GitHub release
  • Loading branch information
mmarum-sugarcrm authored Jan 2, 2018
2 parents b8ebdbd + 2634641 commit 1cab093
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 14 deletions.
42 changes: 31 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 1cab093

Please sign in to comment.