Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

Code Block
titlesl-taskrunner-cfg.json example
{
    "tokenFile": "config./myconfig/sltoken.txt",
	"bitbucketServer":
        {
            "url": "http://bitbucket.internal.net:7990",
            "token":"<personal access token>"
        }
}

...

Once the configuration file is created, run the SeaLights task runner .jar file, specifying the configuration file created in the previous step:

Code Block
titleRunning the SeaLights Task Runner using a configuration file
java -Dsl.config.file=config./myconfig/sl-taskrunner-cfg.json -jar ./sl_task_runner.jar


Alternatively, the same parameters can be specified directly as Java params:

Code Block
titleRunning the SeaLights Task Runner using Java parameters
java -Dsl.tokenFile=./path/tomyconfig/sltoken.txt -Dsl.bitbucketServer.url=http://bitbucket.internal.net:7990 -Dsl.bitbucketServer.token=<personal access token> -jar ./sl_task_runner.jar
Common configuration properties for the task runner are as follows:

...

sl.enableUpgrade

...

true

...

Flag allows automatic upgrade

...

sl.upgradeIntervalMins

...

1440

...

Interval in minutes for auto-upgrade version checking

...

sl.taskPollingIntervalSecs

...

60

...

Interval in second for getting SL tasks for execution

...

sl.taskTimeoutSecs

...

60

...

Time in second allocated for task execution; if expires, task will be aborted and reported with timeout status

...

sl.logs.sendIntervalMin

...

5

...

Interval in minutes for sending accumulated logs to the cloud. If not defined, is forced to the default value on start

...

sl.token

...

-

...

Access token generated from the SeaLights server

...

sl.tokenFile

...

-

...

Path to file containing the access token generated from the SeaLights server

...


Info

See Task Runner Agent - Command Reference for full list of parameters


Configuring the BitBucket Pull Request to compare data to SeaLights

...

You create the Pull Request build session ID by using the SeaLights Java Build Scanner (See: Downloading the java agent files) with the prConfig option:


Code Block
languagebash
themeEclipse
titleSample prConfig

...

command
linenumberstrue
java -jar sl-build-scanner.jar -prConfig -

...

appname "MyApp" -

...

latestCommit $BITBUCKET_COMMIT -

...

pullRequestNumber 

...

$BITBUCKET_PR_

...

ID -

...

repoUrl $BITBUCKET_REPO_SLUG -

...

targetBranch 

...

origin/$BITBUCKET_PR_DESTINATION_BRANCH -tokenfile sl_acc_token.txt -pi "*

...

co.sealights.

...

sample.*"


Note

The packages included and excluded should be exactly the same as what was defined to SeaLights for the merged branch so that the compared results will be the same


Info

See prConfig - Command Reference ' for full parameter details in Java agent, node agent or via the Sealights Jenkins plugin.

Pull Request parameters as seen on a Bitbucket page

...

Sealights PR Parameter
BitBucket Env. Variable
Comment
pullRequestNumberBITBUCKET_PR_ID
latestCommitBITBUCKET_COMMIT
repoUrl BITBUCKET_REPO_SLUGIn some configurations, you may need to prepend the base URL of your repository, like "https://bitbucket.mycompany.int/$BITBUCKET_REPO_SLUG"
targetBranchBITBUCKET_PR_DESTINATION_BRANCHThis is the branch name itself and might need to have a prefix added (Like: "origin/") to match the branch that was provided to SeaLights when scanning the merged branch

...

languagebash
themeEclipse
titleSample prConfig command
linenumberstrue

...

Sample of Results on the BitBucket Pull Request page

...