In our example we'll write a simple script, that could run repeatedly and will upload & deploy our bundle to group of Linux platforms.
- we need RHQ Bundle - simple bundle which just contains 1 file to be laid down
- upload it to RHQ Server
- create group of all Linux platforms (or skip if it already existed)
- deploy our bundle - in case our bundle with given version already exists on server, it will just be redeployed
We'll need rhqapi.js (as it is not yet part RHQ CLI) and we'll add it to modules
cd rhq-remoting-cli-4.13.0-SNAPSHOT; wget https://raw.githubusercontent.com/rhq-project/samples/master/cli/rhqapi/rhqapi.js -O samples/modules/rhqapi.js
The script:
Download the script and bundle and put it in rhq-remoting-cli-4.13.0-SNAPSHOT/bin.
Run:
./rhq-cli.sh -u rhqadmin -p rhqadmin -f deploy-bundle.js Logging in with default host: [localhost] Logging in with default port: [7080] Remote server version is: 4.13.0-SNAPSHOT (26fc58f) Login successful Bundle uploaded to server 16:08:14 [INFO] Creating a group 'LinuxPlatformsGroup', with following children: '[10001] localhost.localdomain (Linux::Platforms)' 16:08:14 [INFO] Parameter baseName was not passed, using default : Root File System Created bundle destination targetting to /tmp of 1 Linux platforms Deploying to LinuxPlatforms PageList[BundleVersion[id=10002,name=SampleBundle,version=1.0]] 16:08:25 [INFO] Bundle deployment finished with status : Success Bundle has been deployed