## What changes were proposed in this pull request?
New cli script to create a maven tar.gz artifact:
- `--clean` option to just delete dist directories
- by default it uses `mvn install` on the generated tar.gz, that install the
artifact into local maven repository
- `--deploy` option to use `mvn deploy` for uploading generated tar.gz artifact
to remote maven repository
- `--version` option to provide the artifact and generated python dist version
- update setup.py script to read the version from pom.xml during dist building,
otherwise it uses PKG-INFO to get the right version, therefore if you are
overriding the version during the build, it will always use the right version
with pip or setup.py
How it works:
with setup.py an installable distribution created, with pip the packages are
installed locally, then the install-ambari-python script creates a tar.gz from
the installd packages and upload it to a maven repo (tar.gz content is the
site-packages, the python version before that is not included)
after the artifacts are installed to maven repos, these could be provided in
external projects (to use to extend PYTHONPATH variable, in order to run tests
against any stack code, like in MPacks);
Maven example:
```xml
<dependency>
<groupId>org.apache.ambari</groupId>
<artifactId>ambari-python</artifactId>
<version>2.0.0.0-SNAPSHOT</version>
<scope>test</scop>
</dependency>
```
Gradle example:
```groovy
testCompile "org.apache.ambari:ambari-python:[email protected]"
```
So in an external project, the ambari python files can be extracted during
build time, and add them to the PYTHONPATH
Usage examples:
Install to maven local repo
```bash
./install-ambari-python.sh
```
Deploy to maven remote repo
```bash
./install-ambari-python.sh --deploy -i <repoId> -r <repoUrl>
```
## How was this patch tested?
Manually, and include ambari packages in external repos (untar pyton files into
the build folder and put them to PYTHONPATH before that)
Please review @g-boros @jonathan-hurley @rlevas @zeroflag @adoroszlai
[ Full content available at: https://github.com/apache/ambari/pull/2273 ]
This message was relayed via gitbox.apache.org for [email protected]