-
Notifications
You must be signed in to change notification settings - Fork 713
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
Adding plugin specific code before CasC installs plugin kills Jenkins #625
Comments
Same issue, this one with
Fresh jenkins/jenkins docker image; install CASC plugins. Create new configuration file: plugins:
required:
docker-plugin: latest
sites:
- id: "default"
url: "https://updates.jenkins.io/experimental/update-center.json"
jenkins:
clouds:
- docker:
name: "docker"
dockerApi:
dockerHost:
uri: "unix:///var/data/sys/run/docker/docker.sock" Attempt to reload configuration:
The bug is simple: CASC is not restarting the Jenkins instance when installing |
This is #280 once again. |
@Casz Is this the only way? How do we managed CASC for new plugins? I'm trying to configure a third-party install of Jenkins. It doesn't come with these plugins pre-installed; I need to add them. I also want to SCM the need of these plugins and their configurations. We're running into a chicken 'n egg situation here. How do I pre-install plugins, via Code, on a third-party pre-installed Jenkins instance? |
Roll your jenkins instance into a docker container (most of that is already done for you https://hub.docker.com/r/jenkins/jenkins/ ), during the docker build you preinstall the plugins. Then deploy the container with the new plugins. Or use https://github.com/jenkinsci/custom-war-packager Here is are some example repos: here is our take on a dockerfile for our jenkins master FROM jenkins/jenkins:lts-alpine
ARG threeshapecrt=/usr/local/share/ca-certificates/3shape.crt
ARG keystore=$JAVA_HOME/jre/lib/security/cacerts
ARG rootca=https://artifactorydk.3shape.local/Download/tools/3shape-root-ca.pem
ENV CASC_JENKINS_CONFIG=/usr/share/jenkins/ref/jenkins.yaml
# add ca cert
USER root
RUN curl -sSfLk $rootca -o $threeshapecrt && \
keytool -file $threeshapecrt -trustcacerts -import -alias 3shape-ca -storepass changeit -noprompt -keystore $keystore
RUN update-ca-certificates
# disable upgrade wizard
USER jenkins
RUN echo $JENKINS_VERSION | tee \
/usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state \
/usr/share/jenkins/ref/jenkins.install.InstallUtil.lastExecVersion
# copy preinstalled plugins list
COPY --chown=jenkins plugins.txt /usr/share/jenkins/ref/plugins.txt
# plugin installation layer
RUN mkdir -p /usr/share/jenkins/ref/plugins && \
install-plugins.sh < /usr/share/jenkins/ref/plugins.txt && \
curl -sSfL https://artifactorydk.3shape.local/maven/argelbargel/jenkins/plugins/gitlab-branch-source/0.7.6.2-SNAPSHOT/gitlab-branch-source-0.7.6.2-20181203.211221-1.hpi \
-o /usr/share/jenkins/ref/plugins/gitlab-branch-source.jpi && \
curl -sSfL https://artifactorydk.3shape.local/artifactory/maven/org/jenkins-ci/plugins/docker-workflow/1.18.0.2-SNAPSHOT/docker-workflow-1.18.0.2-20181213.095203-1.hpi \
-o /usr/share/jenkins/ref/plugins/docker-workflow.jpi && \
curl -sSfL http://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/git-client/3.0.0-beta6-rc1827.ac5f9c819272/git-client-3.0.0-beta6-rc1827.ac5f9c819272.hpi \
-o /usr/share/jenkins/ref/plugins/git-client.jpi && \
curl -sSfL https://artifactorydk.3shape.local/artifactory/maven/org/jenkins-ci/plugins/vsphere-cloud/3.0-SNAPSHOT/vsphere-cloud-3.0-20181212.233446-3.hpi \
-o /usr/share/jenkins/ref/plugins/vsphere-cloud.jpi
# copy configuration as code config
COPY --chown=jenkins jenkins.yaml /usr/share/jenkins/ref/jenkins.yaml |
running a jenkins in a docker container and installing plugins via install-plugins.sh is the recommended solution. It comes with limitations but it is the only one that works good right now |
That's unfortunate, then. I don't have control over the container. It's a third-party container (Altoros Jenkins) installed by a third-party (Pivotal). I'll just re-run the configuration multiple times until everything installs and restarts. This is nice and all if you have direct control over your Jenkins installs. However, a number of us don't. |
We no longer support plugin installation as of v1.8 |
New Jenkins server. CasC plugin is installed, then Jenkins is restarted and config file added. Having the code for the bitbucket server endpoint in the CasC config file causes Jenkins to not boot and only show the below stack trace.
When system is created without bitbucket entry in config, and only added after CasC installs all the plugins and Jenkins manually restarted again with the new config info in the yaml, it works.
This kinda defeats the purpose of having configuration code if having the desired config loaded at the same time/prior to the plugin install causes the system to crash. Is there a way to make CasC ignore code that isn't applicable until after a plugin is installed?
Am I doing something wrong with how i'm setting up the yaml or my order of operations? None of the plugins I install seem to auto restart Jenkins as in #622.
Any help would be appreciated.
jenkins.yaml:
Stack trace:
The text was updated successfully, but these errors were encountered: