-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from RobertNorthard/master
Upgrade Jenkins to 2.107.3 LTS, plugins and remove scriptler
- Loading branch information
Showing
12 changed files
with
284 additions
and
237 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* -text | ||
* -text |
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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
FROM jenkins:2.7.4 | ||
|
||
MAINTAINER Nick Griffin, <nicholas.griffin> | ||
|
||
ENV GERRIT_HOST_NAME gerrit | ||
ENV GERRIT_PORT 8080 | ||
ENV GERRIT_SSH_PORT 29418 | ||
ENV GERRIT_PROFILE="ADOP Gerrit" GERRIT_JENKINS_USERNAME="" GERRIT_JENKINS_PASSWORD="" | ||
|
||
# Copy in configuration files | ||
COPY resources/plugins.txt /usr/share/jenkins/ref/ | ||
COPY resources/init.groovy.d/ /usr/share/jenkins/ref/init.groovy.d/ | ||
COPY resources/scripts/ /usr/share/jenkins/ref/adop_scripts/ | ||
COPY resources/jobs/ /usr/share/jenkins/ref/jobs/ | ||
COPY resources/scriptler/ /usr/share/jenkins/ref/scriptler/scripts/ | ||
COPY resources/views/ /usr/share/jenkins/ref/init.groovy.d/ | ||
COPY resources/m2/ /usr/share/jenkins/ref/.m2 | ||
COPY resources/entrypoint.sh /entrypoint.sh | ||
COPY resources/scriptApproval.xml /usr/share/jenkins/ref/ | ||
|
||
# Reprotect | ||
USER root | ||
RUN chmod +x -R /usr/share/jenkins/ref/adop_scripts/ && chmod +x /entrypoint.sh | ||
# USER jenkins | ||
|
||
# Environment variables | ||
ENV ADOP_LDAP_ENABLED=true LDAP_IS_MODIFIABLE=true ADOP_ACL_ENABLED=true ADOP_SONAR_ENABLED=true ADOP_ANT_ENABLED=true ADOP_MAVEN_ENABLED=true ADOP_NODEJS_ENABLED=true ADOP_GERRIT_ENABLED=true | ||
ENV LDAP_GROUP_NAME_ADMIN="" | ||
ENV JENKINS_OPTS="--prefix=/jenkins -Djenkins.install.runSetupWizard=false" | ||
ENV PLUGGABLE_SCM_PROVIDER_PROPERTIES_PATH="/var/jenkins_home/userContent/datastore/pluggable/scm" | ||
ENV PLUGGABLE_SCM_PROVIDER_PATH="/var/jenkins_home/userContent/job_dsl_additional_classpath/" | ||
|
||
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/ref/plugins.txt | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
FROM jenkins/jenkins:2.107.3 | ||
|
||
MAINTAINER Nick Griffin, <nicholas.griffin> | ||
|
||
ENV GERRIT_HOST_NAME gerrit | ||
ENV GERRIT_PORT 8080 | ||
ENV GERRIT_SSH_PORT 29418 | ||
ENV GERRIT_PROFILE="ADOP Gerrit" GERRIT_JENKINS_USERNAME="" GERRIT_JENKINS_PASSWORD="" | ||
|
||
# Copy in configuration files | ||
COPY resources/plugins.txt /usr/share/jenkins/ref/ | ||
COPY resources/init.groovy.d/ /usr/share/jenkins/ref/init.groovy.d/ | ||
COPY resources/scripts/ /usr/share/jenkins/ref/adop_scripts/ | ||
COPY resources/jobs/ /usr/share/jenkins/ref/jobs/ | ||
COPY resources/views/ /usr/share/jenkins/ref/init.groovy.d/ | ||
COPY resources/m2/ /usr/share/jenkins/ref/.m2 | ||
COPY resources/entrypoint.sh /entrypoint.sh | ||
COPY resources/scriptApproval.xml /usr/share/jenkins/ref/ | ||
|
||
# Reprotect | ||
USER root | ||
RUN chmod +x -R /usr/share/jenkins/ref/adop_scripts/ && chmod +x /entrypoint.sh | ||
# USER jenkins | ||
|
||
# Environment variables | ||
ENV ADOP_LDAP_ENABLED=true LDAP_IS_MODIFIABLE=true ADOP_ACL_ENABLED=true ADOP_SONAR_ENABLED=true ADOP_ANT_ENABLED=true ADOP_MAVEN_ENABLED=true ADOP_NODEJS_ENABLED=true ADOP_GERRIT_ENABLED=true | ||
ENV LDAP_GROUP_NAME_ADMIN="" | ||
ENV JENKINS_OPTS="--prefix=/jenkins -Djenkins.install.runSetupWizard=false" | ||
ENV PLUGGABLE_SCM_PROVIDER_PROPERTIES_PATH="/var/jenkins_home/userContent/datastore/pluggable/scm" | ||
ENV PLUGGABLE_SCM_PROVIDER_PATH="/var/jenkins_home/userContent/job_dsl_additional_classpath/" | ||
|
||
RUN xargs /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt | ||
RUN echo "KexAlgorithms diffie-hellman-group1-sha1" >> /etc/ssh/ssh_config | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
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,11 @@ | ||
import hudson.security.csrf.DefaultCrumbIssuer | ||
import jenkins.model.Jenkins | ||
|
||
Thread.sleep { | ||
|
||
sleep 3000 | ||
|
||
def instance = Jenkins.instance | ||
instance.setCrumbIssuer(new DefaultCrumbIssuer(false)) | ||
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
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,39 @@ | ||
/* | ||
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. | ||
*/ | ||
|
||
/* | ||
Disable all JNLP protocols except for JNLP4. JNLP4 is the most secure agent | ||
protocol because it is using standard TLS. | ||
source: https://github.com/samrocketman/jenkins-bootstrap-shared/blob/master/scripts/configure-jnlp-agent-protocols.groovy | ||
*/ | ||
import jenkins.model.Jenkins | ||
|
||
Thread.start { | ||
sleep 3000 | ||
|
||
println "--> Configuring JNLP Agent Protocols" | ||
|
||
Jenkins jenkins = Jenkins.instance | ||
|
||
if(!jenkins.isQuietingDown()) { | ||
Set<String> agentProtocolsList = ['JNLP4-connect', 'JNLP2-connect', 'Ping'] | ||
if(!jenkins.getAgentProtocols().equals(agentProtocolsList)) { | ||
jenkins.setAgentProtocols(agentProtocolsList) | ||
jenkins.save() | ||
} | ||
} | ||
else { | ||
println 'Shutdown mode enabled. Configure Agent Protocols SKIPPED.' | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
resources/init.groovy.d/adop_slave_master_access_control.groovy
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,12 @@ | ||
import jenkins.model.* | ||
import jenkins.security.s2m.AdminWhitelistRule | ||
|
||
Thread.start { | ||
sleep 3000 | ||
|
||
println "--> Enabling slave master access control" | ||
|
||
Jenkins.instance.injector.getInstance(AdminWhitelistRule.class).setMasterKillSwitch(false); | ||
|
||
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
Oops, something went wrong.