-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81e0399
commit 17b568c
Showing
6 changed files
with
141 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
system_message = ''' | ||
<!-- | ||
style color schemes come from bootstrap alerts | ||
http://www.w3schools.com/bootstrap/bootstrap_alerts.asp | ||
success: | ||
background-color: #dff0d8; | ||
border: 1px solid #d6e9c6; | ||
color: #3c763d; | ||
info: | ||
background-color: #d9edf7; | ||
border: 1px solid #bce8f1; | ||
color: #31708f; | ||
warning: | ||
background-color: #fcf8e3; | ||
border: 1px solid #faebcc; | ||
color: #8a6d3b; | ||
danger: | ||
background-color: #f2dede; | ||
border: 1px solid #ebccd1; | ||
color: #a94442; | ||
--> | ||
<style> | ||
div#systemmessage { | ||
background-color: #dff0d8; | ||
border: 1px solid #d6e9c6; | ||
border-radius: 3px; | ||
margin-bottom: 10px; | ||
padding-left: 10px; | ||
padding-right: 10px; | ||
} | ||
div#systemmessage p { | ||
color: #3c763d; | ||
} | ||
</style> | ||
<p> | ||
<b>New and Improved:</b> welcome to a fresh redesign of | ||
<tt>build.gimp.org</tt>. This re-design builds GIMP in a | ||
<a href="https://github.com/gimp-ci/docker-jenkins-gimp">Docker container</a>. To see the new GIMP build pipelines click the "Open Blue Ocean" link in the menu to the left.. | ||
</p> | ||
''' | ||
|
||
master_settings = [ | ||
system_message: system_message, | ||
frontend_url: 'https://build.gimp.org/', | ||
master_usage: 'normal' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
Copyright (c) 2015-2018 Sam Gleske - https://github.com/samrocketman/jenkins-bootstrap-shared | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
/* | ||
Configure authorization strategy for public READ access and admin-only | ||
logins. | ||
*/ | ||
|
||
//import hudson.security.ProjectMatrixAuthorizationStrategy | ||
import hudson.model.User | ||
import hudson.security.GlobalMatrixAuthorizationStrategy | ||
import jenkins.model.Jenkins | ||
|
||
def installed_plugins = Jenkins.instance.pluginManager.plugins*.shortName | ||
//configure the authorization strategy | ||
def authz_strategy = new GlobalMatrixAuthorizationStrategy() | ||
//set anonymous permissions | ||
if('embeddable-build-status' in installed_plugins) { | ||
//only add permission if embeddable-build-status plugin is installed | ||
authz_strategy.add(this.class.classLoader.loadClass("org.jenkinsci.plugins.badge.PublicBadgeAction").VIEW_STATUS, 'anonymous') | ||
} | ||
//authz_strategy.add(Item.DISCOVER, 'anonymous') | ||
authz_strategy.add(Item.READ, 'anonymous') | ||
authz_strategy.add(Jenkins.READ, 'anonymous') | ||
authz_strategy.add(View.READ, 'anonymous') | ||
//Grant admin perms to authenticated users | ||
authz_strategy.add(Jenkins.ADMINISTER, 'authenticated') | ||
//Configure global authorization | ||
Jenkins.instance.authorizationStrategy = authz_strategy | ||
//save settings to persist across restarts | ||
Jenkins.instance.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
Copyright (c) 2015-2018 Sam Gleske - https://github.com/samrocketman/jenkins-bootstrap-shared | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
/* | ||
Sets the primary view of Jenkins. | ||
*/ | ||
|
||
import hudson.model.View | ||
import jenkins.model.Jenkins | ||
|
||
Jenkins j = Jenkins.instance | ||
|
||
default_view = 'Status Overview' | ||
|
||
View desired_view = j.getView(default_view) | ||
if(desired_view) { | ||
if(desired_view != j.primaryView) { | ||
j.primaryView = desired_view | ||
j.save() | ||
println "Primary view is now '${default_view}'." | ||
} | ||
else { | ||
println "Nothing changed. Primary view is already '${default_view}'." | ||
} | ||
} | ||
else { | ||
println "ERROR: '${default_view}' does not exist as an available view." | ||
} |