Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added netci for jenkins #4

Merged
merged 5 commits into from
Aug 4, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions netci.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import jobs.generation.Utilities
import jobs.generation.InternalUtilities

def project = GithubProject
def branch = GithubBranchName

// Generate a PR/nonPR job for debug (test only), which just does testing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix comment now that only or jobs are generated.

[true, false].each { isPR ->
['Debug', 'Release'].each { config ->
def lowerCaseConfig = config.toLowerCase()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It seems like you are only ever using lowerCaseConfig, so it would probably make sense to just do ['debug', 'release'].each { config -> and then use config directly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use config at the bottom, for setting the PR hook names.


def newJobName = InternalUtilities.getFullJobName(project, "windows_$lowerCaseConfig", isPR)
Copy link
Contributor

@brthor brthor Aug 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we test on non-windows as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@natidea and @eerhardt and I were talking about this offline, and we were only thinking Windows for the moment.


def newJob = job(newJobName) {
steps {
batchFile("build.cmd /$lowerCaseConfig")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this in my PR last night. This should be
'build.cmd -Configuration $config'

}
}

// TODO: For when we actually have unit tests in this repo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should file a bug and reference it here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do after this is merged.

// Utilities.addXUnitDotNETResults(myJob, '**/xUnitResults/*.xml')

Utilities.setMachineAffinity(newJob, 'Windows_NT')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to additionally specify either latest-or-auto-internal or latest-dev15-internal (both contain dev12 and dev14, but the latter also contains dev15). For example: Utilities.setMachineAffinity(newJob, 'Windows_NT', 'latest-dev15-internal').

This is required for all internal jobs to ensure nothing can be maliciously pulled off a machine by an arbitrary PR made against a public repo.

InternalUtilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
Utilities.addHtmlPublisher(newJob, "TestResults", "Unit Test Results", "index.html")

if (isPR) {
Utilities.addGithubPRTriggerForBranch(newJob, branch, "Windows $config")
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need non-PR jobs? Don't we only need Jenkins to run PR tests, and then VSO/Microbuild will run our official build after code is checked in?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to put build status tags in our README that match the rest of the repos, we'll get those Jenkins.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the 'dotnet/cli' repo, we put build status tags in our README that point to our official VSO builds - which makes more sense to me. I'd rather know if our official build is passing and publishing assets correctly than a Jenkins run.

See https://github.com/dotnet/cli#build-status for the CLI badges.

Thoughts?

Utilities.addGithubPushTrigger(newJob)
}
}
}