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
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:
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.
David Mason commented:
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
allow additional arguments to be passed straight through to maven (probably after --)
David Mason commented:
Created attachment 1024897
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.
We are closing all the old issues to have more clarity in our backlog for Zanata project. Feel free to re-open or leave a comment if you require our attention on your Jira.