Skip to content

Commit

Permalink
run jenkings gradle build in memory constrained pod
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Minter committed Dec 18, 2017
1 parent e986a9e commit 447f326
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 4 deletions.
25 changes: 21 additions & 4 deletions test/extended/builds/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ func debugAnyJenkinsFailure(br *exutil.BuildResult, name string, oc *exutil.CLI,
var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
defer g.GinkgoRecover()
var (
jenkinsTemplatePath = exutil.FixturePath("..", "..", "examples", "jenkins", "jenkins-ephemeral-template.json")
mavenSlavePipelinePath = exutil.FixturePath("..", "..", "examples", "jenkins", "pipeline", "maven-pipeline.yaml")
jenkinsTemplatePath = exutil.FixturePath("..", "..", "examples", "jenkins", "jenkins-ephemeral-template.json")
mavenSlavePipelinePath = exutil.FixturePath("..", "..", "examples", "jenkins", "pipeline", "maven-pipeline.yaml")
mavenSlaveGradlePipelinePath = exutil.FixturePath("testdata", "builds", "gradle-pipeline.yaml")
//orchestrationPipelinePath = exutil.FixturePath("..", "..", "examples", "jenkins", "pipeline", "mapsapp-pipeline.yaml")
blueGreenPipelinePath = exutil.FixturePath("..", "..", "examples", "jenkins", "pipeline", "bluegreen-pipeline.yaml")
clientPluginPipelinePath = exutil.FixturePath("..", "..", "examples", "jenkins", "pipeline", "openshift-client-plugin-pipeline.yaml")
Expand Down Expand Up @@ -142,7 +143,7 @@ var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
}
)

g.Context("Pipeline with maven slave", func() {
g.Context("Pipelines with maven slave", func() {
g.BeforeEach(func() {
setupJenkins()

Expand Down Expand Up @@ -184,7 +185,7 @@ var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
}
})

g.It("should build and complete successfully", func() {
g.It("should build a maven project and complete successfully", func() {
// instantiate the template
g.By(fmt.Sprintf("calling oc new-app -f %q", mavenSlavePipelinePath))
err := oc.Run("new-app").Args("-f", mavenSlavePipelinePath).Execute()
Expand All @@ -207,6 +208,22 @@ var _ = g.Describe("[Feature:Builds][Slow] openshift pipeline build", func() {
_, err = exutil.GetEndpointAddress(oc, "openshift-jee-sample")
o.Expect(err).NotTo(o.HaveOccurred())
})

g.It("should build a gradle project and complete successfully", func() {
err := oc.Run("create").Args("-f", mavenSlaveGradlePipelinePath).Execute()
o.Expect(err).NotTo(o.HaveOccurred())

// start the build
g.By("waiting for the build to complete")
br := &exutil.BuildResult{Oc: oc, BuildName: "gradle-1"}
err = exutil.WaitForBuildResult(oc.BuildClient().Build().Builds(oc.Namespace()), br)
if err != nil || !br.BuildSuccess {
exutil.DumpBuilds(oc)
exutil.DumpPodLogsStartingWith("maven", oc)
}
debugAnyJenkinsFailure(br, oc.Namespace()+"-gradle-pipeline", oc, true)
br.AssertSuccess()
})
})

g.Context("Pipeline using config map slave", func() {
Expand Down
35 changes: 35 additions & 0 deletions test/extended/testdata/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions test/extended/testdata/builds/gradle-pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
kind: BuildConfig
apiVersion: v1
metadata:
name: gradle
spec:
strategy:
type: JenkinsPipeline
jenkinsPipelineStrategy:
jenkinsfile: |-
node("maven") {
git url: "https://github.com/openshift/gs-spring-boot-spock.git"
sh "./gradlew build"
}
triggers:
- type: ConfigChange

0 comments on commit 447f326

Please sign in to comment.