Commit Graph

356 Commits

Author SHA1 Message Date
R. Tyler Croy 59ca4cc5ef
Set the default Docker Label for Pipeline
Now that there is more than one kind of agent available, we need to explicitly
state where a Docker workload should run.

Fixes #33
2017-08-25 09:25:09 -07:00
R. Tyler Croy b38166e12b
Add a new disk image which includes bash for FreeBSD 2017-08-24 21:23:40 -07:00
R. Tyler Croy c542c25395
Set some of those important environment variables the Jenkins master needs 2017-08-24 21:23:34 -07:00
R. Tyler Croy 7d6676c015
This is about the extent of documentation I feel like writing right now 2017-08-24 21:23:34 -07:00
R. Tyler Croy 348a10baa0 Merge pull request #32 from rtyler/jgit
Properly configure JGit as the default Git tool
2017-08-24 19:55:01 -07:00
R. Tyler Croy 018ff57b02 Merge pull request #31 from rtyler/jnlp4
Restrict the JNLP protocols to only JNLP4 and Ping
2017-08-24 19:44:57 -07:00
R. Tyler Croy e57338aedb
Properly configure JGit as the default tool
I HAVE NO IDEA WHAT IS GOING ON HERE.
2017-08-24 19:42:30 -07:00
R. Tyler Croy 246a0a2487
Restrict the JNLP protocols to only JNLP4 and Ping
Fixes #19
2017-08-24 17:37:02 -07:00
R. Tyler Croy ec9da5a138
GAH 2017-08-23 23:47:07 -07:00
R. Tyler Croy 80b86edfc0
Yet another stab in the dark
HOW DOES ANY OF THIS ACTUALLY WORK.

This only seems to fail in production when booting the instance, but not when
this script executes at runtime.

	java.lang.ClassCastException: [Lhudson.tools.ToolInstallation; cannot be cast to [Lhudson.plugins.git.GitTool;
		at hudson.plugins.git.GitTool.getInstallations(GitTool.java:68)
		at hudson.plugins.git.GitTool.onLoaded(GitTool.java:127)
	Caused: java.lang.reflect.InvocationTargetException
		at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
		at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
		at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		at java.lang.reflect.Method.invoke(Method.java:498)
		at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
	Caused: java.lang.Error
		at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
		at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
		at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
		at jenkins.model.Jenkins$7.runTask(Jenkins.java:1090)
		at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
		at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
		at java.lang.Thread.run(Thread.java:745)
	Caused: org.jvnet.hudson.reactor.ReactorException
		at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
		at jenkins.InitReactorRunner.run(InitReactorRunner.java:47)
		at jenkins.model.Jenkins.executeReactor(Jenkins.java:1124)
		at jenkins.model.Jenkins.<init>(Jenkins.java:929)
		at hudson.model.Hudson.<init>(Hudson.java:86)
		at hudson.model.Hudson.<init>(Hudson.java:82)
		at hudson.WebAppMain$3.run(WebAppMain.java:235)
	Caused: hudson.util.HudsonFailedToLoad
		at hudson.WebAppMain$3.run(WebAppMain.java:252)
2017-08-23 23:43:18 -07:00
R. Tyler Croy 88de6f4b92
Remove the default git tool 2017-08-23 23:37:05 -07:00
R. Tyler Croy 2fffa4d3bd
Avoid the save() method
#yolo
2017-08-23 23:34:22 -07:00
R. Tyler Croy e903fb02d9
The pull request builder really needs a way to validate the Groovy 2017-08-23 23:29:06 -07:00
R. Tyler Croy 632c98062e Merge pull request #30 from rtyler/freebsd
Add a FreeBSD 11.1-RELEASE VM template to the mix
2017-08-23 23:26:46 -07:00
R. Tyler Croy b0662450cc
Add a FreeBSD 11.1-RELEASE VM template to the mix
YAY
2017-08-23 21:42:19 -07:00
R. Tyler Croy 9119cf968b Add an embedded build status 2017-08-23 21:15:18 -07:00
R. Tyler Croy c2e683f834
By default the installations will only be sized at one element anyways, duh!
Just nuke the installations on every boot and replace it with a JGit entry
2017-08-23 20:32:45 -07:00
R. Tyler Croy fcbd7f0046
Ignore .kube in symlink and directory form 2017-08-23 20:07:06 -07:00
R. Tyler Croy 62858b5830 Merge pull request #28 from rtyler/default-jgit
Default Jenkins to use the JGit implementation and set some Git defaults
2017-08-23 19:34:51 -07:00
R. Tyler Croy 1b95133732
Default Jenkins to use the JGit implementation and set some Git defaults
Fixes #25
2017-08-23 18:23:28 -07:00
R. Tyler Croy 0d1803abb8 Merge pull request #27 from rtyler/stale-groovy-files
Add an empty file for overriding pre-existing configured files in JENKINS_HOME
2017-08-23 18:20:52 -07:00
R. Tyler Croy 4f078edfbe Merge pull request #26 from rtyler/disable-cli
Disable the Jenkins CLI for all instances
2017-08-23 18:20:23 -07:00
R. Tyler Croy 66176d7a09 Merge pull request #24 from rtyler/build-master-in-pr
Start building the actual master container as part of the Pipeline
2017-08-23 18:20:14 -07:00
R. Tyler Croy e7a122b17a
Add an empty file for overriding pre-existing configured files in JENKINS_HOME
Fixes #21
2017-08-23 17:41:37 -07:00
R. Tyler Croy 55092dd9aa
Disable the Jenkins CLI for all instances
No need to keep this on.

This will satisfy some of #19, but there are still some agent-communication
things which need to be changed there.
2017-08-23 17:34:08 -07:00
R. Tyler Croy f388bb0965
Run maven in batch mode to reduce the clutter in the console output 2017-08-23 17:19:14 -07:00
R. Tyler Croy 7ddd9624e5
Support running Docker in non-interactive scenarios (e.g. Pipeline) 2017-08-23 17:17:16 -07:00
R. Tyler Croy fa4929426b
Archive some artifacts and add some reasonable options to the Pipelin 2017-08-23 17:07:49 -07:00
R. Tyler Croy 287f1ccc01
Start building the full gambit of plugins and the master image in our Pipeline 2017-08-23 16:54:58 -07:00
R. Tyler Croy 894bba913a Merge pull request #23 from CodeValet/fixes-22
Bring some more fixes in, extend the Pipeline a bit.
2017-08-23 16:48:19 -07:00
R. Tyler Croy 5c308fc473
Add some more stages to the Pipeline to dip my toes into building containers 2017-08-23 16:40:20 -07:00
R. Tyler Croy 5095ce5f3f
Disable mDNS when running Jenkins
Fixes #22
2017-08-23 16:37:04 -07:00
R. Tyler Croy 4d975f789f
Add the embeddable build status plugin to the build list 2017-08-23 16:13:34 -07:00
R. Tyler Croy ebf36d0383
Add the Sentry public DSN into the environment variables for JavaScript-based errors 2017-08-23 16:13:00 -07:00
R. Tyler Croy 3ec18fe2f7
Avoid grabbing some jars since we're just building a sentry plugin now 2017-08-23 12:30:30 -07:00
R. Tyler Croy 85c7bd67f2
Moving Sentry into a plugin, blerg 2017-08-23 11:36:10 -07:00
R. Tyler Croy d41f2eb032
Include the sentry-plugin code while building plugins 2017-08-23 11:36:10 -07:00
R. Tyler Croy c16dc0ae30 Merge pull request #16 from CodeValet/ci
Start invoking some important steps inside of the Jenkinsfile to validating PRs
2017-08-22 21:54:15 -07:00
R. Tyler Croy 06fa6b7648
More mashing around trying to make custom images work with the Azure VM Agents plugin
This groovy runs on the latest released version of plugins, which makes me fear
a regression :(
2017-08-22 19:55:21 -07:00
R. Tyler Croy defa145734
Bump the docker-ubuntu image size and hopefully fix the lag to provision in production 2017-08-21 21:45:18 -07:00
R. Tyler Croy 5859f0fa04
Ensure our Jenkins user is added to the docker group after provisioning 2017-08-21 21:02:16 -07:00
R. Tyler Croy ef4ff88322
Add support for provisioning packer-built VMs in Azure
THERE'S NO WAY THIS WORKS ON THE FIRST TRY
2017-08-21 20:59:43 -07:00
R. Tyler Croy 68898c349f
A delay isn't sufficient to avoid concurrent modifications, just make it a list!
Since we'll be coming back periodically and adding handlers to loggers added
later, it's fine to just smash this into a list and iterate on that.
2017-08-21 19:58:36 -07:00
R. Tyler Croy aa399bcf75
Keep a busy-loop going to make sure that Sentry is added to all loggers
When this script executed in production, it hit some thread safety issues.
Hopefully waiting a bit will allow Jenkins to set everything up before we go and
start mutating things.

    Aug 22, 2017 2:44:47 AM jenkins.util.groovy.GroovyHookScript execute
    WARNING: Failed to run script file:/usr/share/jenkins/ref/init.groovy.d/configure-sentry.groovy
    java.util.ConcurrentModificationException
            at java.util.Hashtable$Enumerator.next(Hashtable.java:1378)
            at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2039)
            at org.codehaus.groovy.runtime.dgm$161.invoke(Unknown Source)
            at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
            at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
            at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
            at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
            at configure-sentry.run(configure-sentry.groovy:14)
            at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585)
            at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:136)
            at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:127)
            at jenkins.util.groovy.GroovyHookScript.run(GroovyHookScript.java:110)
            at hudson.init.impl.GroovyInitScript.init(GroovyInitScript.java:41)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
            at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
            at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
            at jenkins.model.Jenkins$7.runTask(Jenkins.java:1090)
            at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
            at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
2017-08-21 19:50:23 -07:00
R. Tyler Croy 6d1b5831f5
Add the SENTRY_DSN environment variable for production error reporting
yay
2017-08-21 19:38:31 -07:00
R. Tyler Croy 976f71b7b1
Add some Sentry jars to the system java classpath
ew ew ew ew ew ew

I tried stuffing these into /usr/share/jenkins/ref/war/WEB-INF/lib but the
expansion of the jenkins.war clobbers anything that the copy_reference_file
shell function puts into that spot
2017-08-21 19:35:25 -07:00
R. Tyler Croy ed51ee36a3
Add a SentryHandler to all logger instances inside of the Jenkins instance on boot
I attempted to incorporate via
`-Djava.util.logging.config.file=/path/to/app.properties` by adding the
sentry-1.5.0.jar into /var/jenkins_home/war/WEB-INF/libs. Unfortunately it
looks like that's not added to the classpath early enough.

This script will not work unless jackson-core.jar and sentry.jar are added into
war/WEB-INF/libs
2017-08-21 19:10:37 -07:00
R. Tyler Croy 4ae526075c
Ensure that overrides are in place for the plugins and userContent
Without this, the new plugin builds won't be properly adopted for instances with
already present /var/jenkins_home directories
2017-08-21 17:30:30 -07:00
R. Tyler Croy e4fe705b14
Start invoking some important steps inside of the Jenkinsfile to validate PRs 2017-08-20 17:08:45 -07:00
R. Tyler Croy 726426734a
Ensure that the container's init.groovy.d/ scripts are always the ones used
Fixes #15
2017-08-20 17:04:49 -07:00