Skip to content

Commit 3d88c56

Browse files
authored
Merge pull request #192 from adriaanm/master
Run community build during release flow
2 parents 60b48e7 + 837ad09 commit 3d88c56

File tree

6 files changed

+80
-62
lines changed

6 files changed

+80
-62
lines changed

recipes/_master-jenkins-jobs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def templDesc(user, repo, branch, path)
3939
:jvmFlavorForBranch => branch != "2.11.x" ? "openjdk" : "oracle",
4040
:jvmVersionForBranch => branch != "2.11.x" ? 8 : 6,
4141
:scalaBranchForBranch => branch == "2.11.x-jdk8" ? "2.11.x" : branch, # only used for community-builds
42-
:behemothForBranch => branch == "2.12.x" ? 2 : 1 # only used for community-builds
42+
:behemothForBranch => branch =~ /^2\.12.*/ ? 2 : 1 # only used for community-builds
4343
}
4444
]
4545
end

templates/default/jobs/scala/integrate/bootstrap.xml.erb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,14 @@
4848
:desc => "The version of akka-actors to include in scala-library-all.pom. NOTE: the release script will NOT build akka, the version specified here needs to be released already. If empty, it will be parsed from versions.properties."},
4949
{:name => "JLINE_VER",
5050
:desc => "The version of jline to use for building the Scala project.NOTE: the release script will NOT build jline, the version specified here needs to be released already.If empty, it will be parsed from versions.properties."},
51+
{:name => "sbtBuildTask",
52+
:desc => "Leave empty to skip testing. Useful when publishing a nightly to run the community build against.",
53+
:default => "testAll"},
5154
{:name => "moduleVersioning",
52-
:desc => "Set to anything but "versions.properties" to build the latest HEAD for all modules."},
55+
:desc => "Set to anything but "versions.properties" to build the latest HEAD for all modules."},
56+
{:name => "testStability",
57+
:desc => "Set to anything but "yes" to avoid running the stability test",
58+
:default => "yes"},
5359
{:name => "publishToSonatype",
5460
:desc => "Set to anything but "yes" to avoid publishing to sonatype. Otherwise, release builds (tagged or SCALA_VER_BASE defined) will be published."}
5561
])

templates/default/jobs/scala/integrate/community-build.xml.erb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,14 @@
1111
jvmVersion: @jvmVersionForBranch,
1212
jvmFlavor: @jvmFlavorForBranch,
1313
params: [
14-
{:name => "scala_ref", :desc => "Ref of scala to build against. To verify PR NNNN on scala/scala, use scala/scala.git\#pull/NNNN/head", :default => "#{@user}/scala.git\##{@scalaBranchForBranch}"},
15-
{:name => "scalac_opts", :desc => "Scala compiler arguments, e.g., -Yopt:l:classpath, passed to project builds (not scala/scala)"},
16-
{:name => "scala_build_bootstrap_opt", :desc => "Set -Dlocker.skip=1 to skip bootstrapping when building scala/scala, or leave empty", :default => "-Dlocker.skip=1"},
17-
{:name => "scala_build_extra_opt", :desc => "Option passed to ant when building scala/scala, e.g., -Dscalac.args.optimise=-Yopt:l:classpath"}
14+
{:name => "version", :desc => "Published Scala version to build the community projects with. This should be a complete build, including modules, and library sources."},
15+
{:name => "projects", :desc => "List of projects to build."},
16+
{:name => "scalac_opts", :desc => "Scala compiler arguments, e.g., -Yopt:l:classpath, passed to project builds."}
1817
]
1918
) %>
20-
<triggers>
21-
<hudson.triggers.TimerTrigger>
22-
<spec>@weekly</spec>
23-
</hudson.triggers.TimerTrigger>
24-
</triggers>
2519
<publishers>
2620
<hudson.tasks.Mailer plugin="[email protected]">
27-
<recipients>adriaan@typesafe.com seth.tisue@typesafe.com</recipients>
21+
<recipients>adriaan@lightbend.com seth.tisue@lightbend.com</recipients>
2822
<dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
2923
<sendToIndividuals>false</sendToIndividuals>
3024
</hudson.tasks.Mailer>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<com.cloudbees.plugins.flow.BuildFlow plugin="[email protected]">
3+
<%= flowProject(
4+
repoUser: @user,
5+
repoRef: @branch,
6+
description: "Flow that bootstraps and runs a community build",
7+
params: [
8+
{:name => "scalac_opts", :desc => "[For community-build] Scala compiler arguments, e.g., -Yopt:l:classpath, passed to project builds."},
9+
{:name => "projects", :desc => "[For community-build] List of projects to build."},
10+
{:name => "sbtBuildTask", :desc => "[For bootstrap] To skip testing, set to e.g. `update`. Useful when publishing a nightly to run the community build against.", :default => "testAll"},
11+
{:name => "publishToSonatype", :desc => "[For bootstrap] Set to anything but &quot;yes&quot; to avoid publishing to sonatype. Otherwise, release builds (tagged or SCALA_VER_BASE defined) will be published."},
12+
{:name => "testStability", :desc => "[For bootstrap] To avoid running the stability test, set to e.g., `no`", :default => "yes"},
13+
{:name => "moduleVersioning", :desc => "[For bootstrap] Set to anything but &quot;versions.properties&quot; to build the latest HEAD for all modules."},
14+
{:name => "SCALA_VER_BASE", :desc => "[For bootstrap] Specifying this parameter will cause a release to be built. If it&apos;s empty (and HEAD does not have a tag that parses as a version), a -nightly release is built."},
15+
{:name => "SCALA_VER_SUFFIX", :desc => "[For bootstrap] Empty for a final release, otherwise, e.g., -RC1 for the first RC or -M3 for the third milestone. (Will be parsed from the tag on SCALA_REF, if any.)"},
16+
{:name => "SCALA_BINARY_VER", :desc => "[For bootstrap] For binary compatible releases (such as 2.11.0 and 2.11.1), the short binary version (e.g. 2.11). Otherwise, the full Scala version."},
17+
{:name => "SCALA_FULL_VER", :desc => "[For bootstrap] For non-snapshot releases, the scala version, otherwise the closest scala version that&apos;s a valid binary version. Used to cross-version the scala continuations plugin."},
18+
{:name => "STARR_REF", :desc => "[For bootstrap] Can be set to a git ref of a separate commit that will be used to build STARR, rather than using a prebuilt STARR based on starr.version in versions.properties. Used when bootstraping compiler changes that change the ABI, e.g. changing name mangling."},
19+
{:name => "XML_VER", :desc => "[For bootstrap] The version to build for scala-xml. If the version already exists, it won&apos;t be published. If empty, it will be parsed from versions.properties (unless moduleVersioning != &quot;versions.properties&quot;)."},
20+
{:name => "PARSERS_VER", :desc => "[For bootstrap] The version to build for scala-parser-combinators. If the version already exists, it won&apos;t be published. If empty, it will be parsed from versions.properties (unless moduleVersioning != &quot;versions.properties&quot;)."},
21+
{:name => "CONTINUATIONS_VER", :desc => "[For bootstrap] The version to build for scala-continuations-plugin and -library. The plugin will be cross-versioned with SCALA_FULL_VER. If the version already exists, it won&apos;t be published. If empty, it will be parsed from versions.properties (unless moduleVersioning != &quot;versions.properties&quot;)."},
22+
{:name => "SWING_VER", :desc => "[For bootstrap] The version to build for scala-swing. If the version already exists, it won&apos;t be published.
23+
If empty, it will be parsed from versions.pr[For bootstrap] operties (unless moduleVersioning != &quot;versions.properties&quot;)."},
24+
{:name => "ACTORS_MIGRATION_VER", :desc => "[For bootstrap] The version to build for scala-partest. If the version already exists, it won&apos;t be published. If empty, it will be parsed from versions.properties (unless moduleVersioning != &quot;versions.properties&quot;)."},
25+
{:name => "PARTEST_VER", :desc => "[For bootstrap] The version to build for scala-partest. If the version already exists, it won&apos;t be published. If empty, it will be parsed from versions.properties (unless moduleVersioning != &quot;versions.properties&quot;)."},
26+
{:name => "SCALACHECK_VER", :desc => "[For bootstrap] The version to build for scalacheck. Not published. If empty, it will be parsed from versions.properties (unless moduleVersioning != &quot;versions.properties&quot;)."},
27+
{:name => "AKKA_ACTOR_VER", :desc => "[For bootstrap] The version of akka-actors to include in scala-library-all.pom. NOTE: the release script will NOT build akka, the version specified here needs to be released already. If empty, it will be parsed from versions.properties."},
28+
{:name => "JLINE_VER", :desc => "[For bootstrap] The version of jline to use for building the Scala project.NOTE: the release script will NOT build jline, the version specified here needs to be released already.If empty, it will be parsed from versions.properties."}
29+
],
30+
buildNameScript: setReleaseBuildNameScript,
31+
dsl: <<-EOX
32+
if (params.repo_ref) buildParams = params
33+
else buildParams = params + [ "repo_ref" : "v$ver" ]
34+
35+
buildRun = build(buildParams, "#{job("integrate/bootstrap")}")
36+
37+
upstreamBuild = buildRun.build
38+
// defines repo_ref, version, sbtDistVersionOverride
39+
upstreamPropsArtifact = upstreamBuild.artifacts.find{it.name == "jenkins.properties"}
40+
41+
if (upstreamPropsArtifact == null) {
42+
out.println('Error: bootstrap did not publish "jenkins.properties" artifact, unable to proceed.')
43+
build.state.setResult(Result.FAILURE)
44+
return
45+
}
46+
47+
buildVersionProps = new java.util.Properties()
48+
buildVersionProps.load(new java.io.FileInputStream(upstreamPropsArtifact.file))
49+
50+
testParams = buildParams + buildVersionProps
51+
52+
parallel (
53+
{ build(testParams, "#{job("integrate/community-build")}") },
54+
)
55+
56+
EOX
57+
) %>
58+
<publishers>
59+
<hudson.tasks.Mailer plugin="[email protected]">
60+
<recipients>[email protected] [email protected]</recipients>
61+
<dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
62+
<sendToIndividuals>false</sendToIndividuals>
63+
</hudson.tasks.Mailer>
64+
</publishers>
65+
<buildNeedsWorkspace>true</buildNeedsWorkspace>
66+
</com.cloudbees.plugins.flow.BuildFlow>

templates/default/jobs/scala/integrate/main.xml.erb-TODO

Lines changed: 0 additions & 49 deletions
This file was deleted.

templates/default/jobs/scala/release/main.xml.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ upstreamBuild = buildRun.build
2121
upstreamPropsArtifact = upstreamBuild.artifacts.find{it.name == "jenkins.properties"}
2222
2323
if (upstreamPropsArtifact == null) {
24-
out.println('Error: publish-core did not publish "jenkins.properties" artifact, unable to proceed.')
24+
out.println('Error: bootstrap did not publish "jenkins.properties" artifact, unable to proceed.')
2525
build.state.setResult(Result.FAILURE)
2626
return
2727
}
@@ -32,6 +32,7 @@ buildVersionProps.load(new java.io.FileInputStream(upstreamPropsArtifact.file))
3232
testParams = buildParams + buildVersionProps
3333
3434
parallel (
35+
{ retry(2, { build(testParams, "#{job("integrate/community-build")}") }) },
3536
{ build(testParams, "#{job("release/package/unix")}") },
3637
{ build(testParams, "#{job("release/package/windows")}") }
3738
)

0 commit comments

Comments
 (0)