diff --git a/examples/jenkins/pipeline/README.md b/examples/jenkins/pipeline/README.md index 025de9422392..709920321f9f 100644 --- a/examples/jenkins/pipeline/README.md +++ b/examples/jenkins/pipeline/README.md @@ -29,19 +29,7 @@ jenkins template represented by jenkinstemplate.json by running these commands a $ oc new-project pipelineproject -4. Run this command to instantiate a Jenkins server and service account in your project: - - If your have persistent volumes available in your cluster: - - $ oc new-app jenkins-persistent - - Otherwise: - - $ oc new-app jenkins-ephemeral - - Note: eventually the instantiation of the Jenkins server and service account will be done automatically when you create a pipeline buildconfig. - -5. Run this command to instantiate the template which will create a pipeline buildconfig and some other resources in your project: +4. Run this command to instantiate the template which will create a pipeline buildconfig and some other resources in your project: If you used cluster up: @@ -53,7 +41,7 @@ jenkins template represented by jenkinstemplate.json by running these commands a At this point if you run `oc get pods` you should see a jenkins pod, or at least a jenkins-deploy pod. (along with other items in your project) This pod was created as a result of the new pipeline buildconfig being defined by the sample-pipeline template. -6. View/Manage Jenkins (optional) +5. View/Manage Jenkins (optional) You should not need to access the jenkins console for anything, but if you want to configure settings or watch the execution, here are the steps to do so: @@ -68,7 +56,9 @@ jenkins template represented by jenkinstemplate.json by running these commands a If you take this approach, run the following command before attempting to log into Jenkins: $ oc annotate sa/jenkins serviceaccounts.openshift.io/oauth-redirecturi.1=http:///securityRealm/finishLogin --overwrite - + + Only include the port in the uri if it is not port 80. + Login with the user name used to create the "pipelineproject" and any non-empty password. 6. Launch a new build diff --git a/pkg/cmd/server/api/v1/conversions.go b/pkg/cmd/server/api/v1/conversions.go index 22974de433e9..78d9d00c068a 100644 --- a/pkg/cmd/server/api/v1/conversions.go +++ b/pkg/cmd/server/api/v1/conversions.go @@ -42,7 +42,7 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error { obj.JenkinsPipelineConfig.ServiceName = "jenkins" } if obj.JenkinsPipelineConfig.AutoProvisionEnabled == nil { - v := false + v := true obj.JenkinsPipelineConfig.AutoProvisionEnabled = &v } diff --git a/test/integration/build_admission_test.go b/test/integration/build_admission_test.go index c14e838967b1..f71f49d3280f 100644 --- a/test/integration/build_admission_test.go +++ b/test/integration/build_admission_test.go @@ -178,11 +178,17 @@ func setupBuildStrategyTest(t *testing.T, includeControllers bool) (clusterAdmin t.Fatalf(err.Error()) } - template, err := testutil.GetTemplateFixture("../../examples/jenkins/jenkins-ephemeral-template.json") + // we need a template that doesn't create service accounts or rolebindings so editors can create + // pipeline buildconfig's successfully, so we're not using the standard jenkins template. + // but we do need a template that creates a service named jenkins. + template, err := testutil.GetTemplateFixture("../../examples/jenkins/master-slave/jenkins-master-template.json") if err != nil { t.Fatalf("unexpected error: %v", err) } - template.Name = "jenkins" + + // pipeline defaults expect to find a template named jenkins-ephemeral + // in the openshift namespace. + template.Name = "jenkins-ephemeral" template.Namespace = "openshift" _, err = clusterAdminClient.Templates("openshift").Create(template)