Conversation
|
General notes:
|
scripts/unit-tests/linux/ovs-git.sh
Outdated
| head -1 $WORKSPACE/gitlog.txt | tee $WORKSPACE/lastrancommit.txt | ||
| } | ||
|
|
||
| function Start-CommitJob { |
There was a problem hiding this comment.
I guess that this function does is starting a job for checking a commit, so the naming should reflect that, it's not "starting a commit job" - it won't commit anything.
There was a problem hiding this comment.
Renamed the functions to reflect what they actually do
scripts/unit-tests/linux/ovs-git.sh
Outdated
| done < $WORKSPACE/gitlog.txt | ||
| } | ||
|
|
||
| export WORKSPACE="/var/lib/jenkins/jobs/master-job/workspace" |
There was a problem hiding this comment.
You never hardcode a workspace that's inside the jenkins-managed workspaces. If you need a common workspace to be shared by multiple jobs, you use a dedicated folder created for that.
There was a problem hiding this comment.
this was a path that was used when testing and forgot to remove it prior to PR
scripts/unit-tests/linux/ovs-git.sh
Outdated
| } | ||
|
|
||
| function Get-GitLog { | ||
| currentcommit=`cat $WORKSPACE/lastrancommit.txt` |
There was a problem hiding this comment.
please use powershell cmd-lets, not aliases that are "linux-like"
scripts/unit-tests/linux/ovs-git.sh
Outdated
| while read line | ||
| do | ||
| echo "Starting job for commitID $line" | ||
| curl -X POST "http://$jenk_user:$jenk_api@10.20.1.3:8080/job/ovs-build-job/buildWithParameters?token=b204eee759ab38ebb986d223f6c5b4ce&commitid=$line" |
There was a problem hiding this comment.
please use powershell cmd-lets, not aliases that are "linux-like"
There was a problem hiding this comment.
This is a linux script and is run on jenkins slave
scripts/unit-tests/linux/ovs-git.sh
Outdated
| if [ ! -e $lastranfile ]; then | ||
| echo "LastRanFile doesn't exist. Creating it." | ||
| cd $WORKSPACE/ovs | ||
| git rev-parse HEAD | tee $WORKSPACE/lastrancommit.txt |
There was a problem hiding this comment.
shouldn't you run a test on that "first commit"?
There was a problem hiding this comment.
Done. Now it will run the "first commit" test
|
|
||
| if ( $Status -eq "ERROR" ) { | ||
| write-host "Sending make error E-mail for $commitID" | ||
| Send-PassEmail $from "mgheorghe@cloudbasesolutions.com" $smtpServer $commitLink $logLink |
There was a problem hiding this comment.
Shouldn't "$to" be listed here as well?
| @@ -0,0 +1,110 @@ | |||
| $ErrorActionPreference = "Stop" | |||
There was a problem hiding this comment.
Is this script required / executed for each run?
jjb/ovs-unit.yaml
Outdated
| - shell: | | ||
| #!/bin/bash | ||
| set -e | ||
| function Check-LastRanFile { |
There was a problem hiding this comment.
why are these functions defined both here and in scripts/unit-tests/linux/ovs-git.sh?
There was a problem hiding this comment.
this will not be present in the jjb
|
|
||
| $Status = $env:status | ||
| $commitID = $env:commitid | ||
| $basePath = "C:\OpenStack\OpenvSwitch" |
There was a problem hiding this comment.
Again, use config.ps1, no static variables defined in main file.
| @@ -0,0 +1,87 @@ | |||
| function Send-PassEmail ($from, $to, $smtpServer, $commitLink, $logLink) { | |||
There was a problem hiding this comment.
Why not a function that takes as parameter also the PASS/FAIL/ERROR status? What's the significant difference between them?
There was a problem hiding this comment.
Combined them into one functions "Send-Email"
…d jjb file since it will be hosted in another repo
No description provided.