Skip to content

really re-enable jenkins autoprovisioning #11543

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

Merged
merged 1 commit into from
Oct 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 5 additions & 15 deletions examples/jenkins/pipeline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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:
Expand All @@ -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://<jenkins_service_ip:jenkins_service_port>/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
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/server/api/v1/conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
10 changes: 8 additions & 2 deletions test/integration/build_admission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down