Using Node.js Agents - Uploading git commit logs
If you do not work with github or cannot provide access to the source folder where the git logs are located, you can generate them on your own and upload them seperatly to the SeaLights servers.
See 'Generating an Agent token' for instructions on how to generate a token
Generating the commit reports
The file must be a json file with an array "commitLog" of commits
Sample command on Linux
echo "{ \"commitLog\": " > commitLog.json
git log --pretty=format:'{"commit": "%H","authorName": "%an","authorEmail": "%ae","commiterName": "%cn","commiterEmail": "%ce","authorDate": "%at000","commiterDate": "%ct000","title": "%f"},' --since="2 days ago" | sed "$ s/,$//" | sed ':a;N;$!ba;s/\r\n\([^{]\)/\\n\1/g'| awk 'BEGIN { print("[") } { print($0) } END { print("]") }' >> commitLog.json
echo "}" >> commitLog.json
BASH
Upload git generated commit log reports
Sample command for a single file
Unix:
./node_modules/.bin/slnodejs uploadReports --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId --reportFile commitLog.json --type "commitLog" --source "script"
Windows:
call .\node_modules\.bin\slnodejs uploadReports --tokenfile \path\to\sltoken.txt --buildsessionidfile buildSessionId --reportFile commitLog.json --type "commitLog" --source "script"
BASH
See 'Node.js Command Reference - Upload report files' for full parameter details
See 'Using Node.js Agents - Uploading multiple files' for information on how to upload multiple files