Option 1: Bamboo Script Task Using Windows PowerShell Interpreter
Create a project and fill in the fields:
Create a new plan:
Fill in the fields and select None for a repository in order to work on a local workspace.
Select Enable Plan.
Run this job in an Agent environment and add a task:
Select a Script task type:
Enter a description for the task, select a Windows PowerShell interpreter, and an Inline script location.
Enter the following in the Script body text box, edit the configuration file to match your needs, and save when done: NOTE: Ensure that Background Intelligent Transfer Service (BITS) is enabled on your project job.
The first command downloads the latest version of Mend Unified Agent jar file to the job folder.
The second command downloads the latest version of Mend Unified Agent configuration file to the job folder.
The third command runs the Jar with regular command-line arguments of the Unified Agent.
It is advised to use the above PowerShell commands only once a week to download the latest version of the Unified Agent for performance reasons and not as part of every build. You can do this using a scheduler task, such as cron.
Running the Job
Go to the Configuration page.
Select Run plan:
The Build Result Summary is then displayed:
Option 2: Bamboo Script Task Using Shell or the 'cmd.exe' Interpreter
Download CURL, add it to your PATH environment variable, and restart Bamboo.
Create a project via the same steps that were described in the previous section.
In the new Script Body window add the following commands:
curl -LJO https://github.com/Mend/unified-agent-distribution/raw/master/standAlone/wss_agent.sh
wss_agent.sh -apiKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx -c [path to config file] -project my-project -d [path to folder to scan]
Note the following:
The first command downloads the wss_agent.sh script file to the job folder.
The second command runs the script wss_agent.sh. This script downloads the latest version of Mend Unified Agent jar file and configuration file to your Bamboo job 'workspace' folder.
The script runs the jar with regular command-line arguments of the Unified Agent.
ApiKey is in the configuration file, and therefore, it is not in the script.
Ensure that you edit the Unified Agent configuration file to match your needs.
Running the Job
Save, enable the job and run it in the way that is described here.