Bug 1220274 - RFE/TECH DEBT: Create build script for Zanata
Summary: RFE/TECH DEBT: Create build script for Zanata
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Zanata
Classification: Retired
Component: Component-Scripts
Version: development
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Damian Jansen
QA Contact: Zanata-QA Mailling List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-11 07:40 UTC by Sean Flanigan
Modified: 2015-07-28 23:18 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: 2
Clone Of:
Environment:
Last Closed: 2015-07-28 23:18:59 UTC
Embargoed:


Attachments (Terms of Use)
A script I use for my quick dev build & deploy (2.23 KB, text/plain)
2015-05-13 05:54 UTC, David Mason
no flags Details

Description Sean Flanigan 2015-05-11 07:40:54 UTC
We need a build script which makes it easy for anyone to build and test Zanata without memorising Maven property names and the relationships between them.  

Basically, the Zanata developer should set some env vars like
- JBOSS_HOME
- EAP_ZIP_URL

Then say "deploy to JBOSS_HOME", or to "run tests against EAP", or "run tests against WildFly", and the build script will choose all the Maven parameters and invoke `mvn` with them.


This script should make development easier, especially when Maven profiles have to be changed (because it can be updated together with the pom), and it should also make it easier to set things up in Jenkins, eg for a matrix build.

Several of us probably have such a script locally, but it would be good to standardise on one script and make it work as well as possible, and to keep it maintained in one place.  Be sure to consult with the other developers and steal from their scripts!

Also, we would need to find a way for the script to play nicely with Jenkins (since in a Maven job, Jenkins invokes Maven directly), perhaps by exporting the chosen Maven options for Jenkins to use.


Some example usage:

./build.sh help: 
  lists the build commands, explains them and the configuration variables

./build.sh deploy (given $JBOSS_HOME):
  build and deploy to JBOSS_HOME as ROOT.war (no need to build functional tests)

./build.sh explode (given $JBOSS_HOME): 
  build and deploy exploded build to JBOSS_HOME as ROOT.war

./build.sh test-eap (given $EAP_ZIP_URL)
  run tests against a downloaded EAP - it should set appserver=eap6, cargo.installation, cargo.basename, appserver.dir.name

./build.sh test-wildfly [optional version parameter]
  run tests against a downloaded WildFly - it should set appserver=wildfly8 (or wildfly/whatever), cargo.installation, cargo.basename, appserver.dir.name, wildfly.version, wildfly.client.version

The script could also invoke etc/scripts/allocate-jboss-ports before running tests, to ensure unique ports during the tests.

Other options to handle:
- quick build for Chrome (-Dchrome), or skip GWT entirely (-Dnogwt)
- skip Arquillian tests but run functional tests
- skip functional tests but skip Arquillian
- run unit tests but skip functional tests (and cargo, etc)
- build and set up for IDE-based functional tests (cargo:run)
- anything else we need

These are just examples, the command names will probably change, and we probably have other build tasks to cover.

Comment 1 David Mason 2015-05-13 05:10:41 UTC
Initial implementation

 - print help when run with no options
 - flag to just print the command without running it. Should be just the command and not other stuff.
 - print the command it runs every time.
 - all the usages in the initial description.
 - separate command for the cargo:run stuff

For later:

 - allow additional arguments to be passed straight through to maven (probably after --)

Comment 2 David Mason 2015-05-13 05:54:36 UTC
Created attachment 1024897 [details]
A script I use for my quick dev build & deploy

This script uses getopts, but only for single-character arguments. We want a more friendly getopts implementation that handles descriptions and long options.

Comment 3 Zanata Migrator 2015-07-28 23:18:59 UTC
Migrated; check JIRA for bug status: http://zanata.atlassian.net/browse/ZNTA-107


Note You need to log in before you can comment on or make changes to this bug.