sheehan / job-dsl-playground Goto Github PK
View Code? Open in Web Editor NEWAn app for debugging Groovy scripts using the Jenkins Job DSL
Home Page: http://job-dsl.herokuapp.com/
License: Apache License 2.0
An app for debugging Groovy scripts using the Jenkins Job DSL
Home Page: http://job-dsl.herokuapp.com/
License: Apache License 2.0
http://job-dsl.herokuapp.com/ leads to an empty page :(
job('b') {
scm {
git('xxx.git', 'master') {
extensions {
cleanBeforeCheckout()
}
}
}
}
<!-- 1. b -->
<project>
<actions></actions>
<description></description>
<keepDependencies>false</keepDependencies>
<properties></properties>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers class='vector'></triggers>
<concurrentBuild>false</concurrentBuild>
<builders></builders>
<publishers></publishers>
<buildWrappers></buildWrappers>
<scm class='hudson.plugins.git.GitSCM'>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>xxx.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<configVersion>2</configVersion>
<disableSubmodules>false</disableSubmodules>
<recursiveSubmodules>false</recursiveSubmodules>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<authorOrCommitter>false</authorOrCommitter>
<clean>false</clean>
<wipeOutWorkspace>false</wipeOutWorkspace>
<pruneBranches>false</pruneBranches>
<remotePoll>false</remotePoll>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<gitTool>Default</gitTool>
<skipTag>true</skipTag>
</scm>
</project>
wrong line:
<extensions>
<hudson.plugins.git.extensions.impl.PerBuildTag></hudson.plugins.git.extensions.impl.PerBuildTag>
</extensions>
I have a couple of DSL scripts where I need to use hudson.util.Secret.fromString(). When I try to validate these in the playground, I get an exception, e.g.:
javaposse.jobdsl.dsl.DslScriptException: (script, line 68) No such property: hudson for class: script
at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngineForParent(DslScriptLoader.java:79)
at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngine(DslScriptLoader.java:135)
at javaposse.jobdsl.dsl.DslScriptLoader$runDslEngine.call(Unknown Source)
at com.sheehan.jobdsl.DslScriptExecutor.execute(DslScriptExecutor.groovy:29)
at com.sheehan.jobdsl.ScriptExecutor$execute.call(Unknown Source)
at Ratpack$_run_closure1_closure3_closure7.doCall(Ratpack.groovy:39)
at ratpack.groovy.internal.ClosureInvoker.invoke(ClosureInvoker.java:65)
at ratpack.groovy.handling.internal.ClosureBackedHandler.handle(ClosureBackedHandler.java:42)
at ratpack.handling.internal.DefaultContext.doNext(DefaultContext.java:448)
at ratpack.handling.internal.DefaultContext.next(DefaultContext.java:223)
at ratpack.http.internal.MethodHandler.handle(MethodHandler.java:41)
at ratpack.handling.internal.DefaultContext.doNext(DefaultContext.java:448)
at ratpack.handling.internal.DefaultContext.insert(DefaultContext.java:237)
at ratpack.handling.internal.ChainHandler.handle(ChainHandler.java:37)
at ratpack.handling.internal.DefaultContext.doNext(DefaultContext.java:448)
at ratpack.handling.internal.DefaultContext.insert(DefaultContext.java:246)
at ratpack.path.internal.PathHandler.handle(PathHandler.java:38)
at ratpack.handling.internal.DefaultContext.doNext(DefaultContext.java:448)
at ratpack.handling.internal.DefaultContext.next(DefaultContext.java:223)
at ratpack.path.internal.PathHandler.handle(PathHandler.java:40)
at ratpack.handling.internal.DefaultContext.doNext(DefaultContext.java:448)
at ratpack.handling.internal.DefaultContext.next(DefaultContext.java:223)
at ratpack.path.internal.PathHandler.handle(PathHandler.java:40)
at ratpack.handling.internal.DefaultContext.doNext(DefaultContext.java:448)
at ratpack.handling.internal.DefaultContext.insert(DefaultContext.java:237)
at ratpack.handling.internal.ChainHandler.handle(ChainHandler.java:37)
at ratpack.handling.internal.DefaultContext.doNext(DefaultContext.java:448)
at ratpack.handling.internal.DefaultContext.insert(DefaultContext.java:237)
at ratpack.handling.internal.ChainHandler.handle(ChainHandler.java:37)
at ratpack.handling.internal.DefaultContext.doNext(DefaultContext.java:448)
at ratpack.handling.internal.DefaultContext.insert(DefaultContext.java:246)
at ratpack.guice.internal.InjectorBindingHandler.handle(InjectorBindingHandler.java:36)
at ratpack.groovy.internal.ScriptBackedApp.handle(ScriptBackedApp.java:97)
at ratpack.handling.internal.DefaultContext.doNext(DefaultContext.java:448)
at ratpack.handling.internal.DefaultContext.next(DefaultContext.java:223)
at ratpack.handling.internal.DefaultContext$2.execute(DefaultContext.java:127)
at ratpack.handling.internal.DefaultContext$2.execute(DefaultContext.java:124)
at ratpack.exec.internal.ExecutionBacking$3.performOperation(ExecutionBacking.java:174)
at ratpack.handling.internal.InterceptedOperation.run(InterceptedOperation.java:43)
at ratpack.exec.internal.ExecutionBacking.intercept(ExecutionBacking.java:171)
at ratpack.exec.internal.ExecutionBacking$UserCodeSegment.run(ExecutionBacking.java:189)
at ratpack.exec.internal.ExecutionBacking.drain(ExecutionBacking.java:136)
at ratpack.exec.internal.ExecutionBacking.tryDrain(ExecutionBacking.java:108)
at ratpack.exec.internal.ExecutionBacking.(ExecutionBacking.java:61)
at ratpack.exec.internal.DefaultExecControl.fork(DefaultExecControl.java:151)
at ratpack.handling.internal.DefaultContext.start(DefaultContext.java:124)
at ratpack.server.internal.NettyHandlerAdapter.channelRead0(NettyHandlerAdapter.java:191)
at ratpack.server.internal.NettyHandlerAdapter.channelRead0(NettyHandlerAdapter.java:80)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103)
at ratpack.server.internal.NettyHandlerAdapter.channelRead(NettyHandlerAdapter.java:127)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:332)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:318)
at io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:332)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:318)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:332)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:318)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:332)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:318)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:125)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:507)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:464)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
at ratpack.exec.internal.DefaultExecController$ExecControllerBindingThreadFactory$1.run(DefaultExecController.java:90)
Caused by: groovy.lang.MissingPropertyException: No such property: hudson for class: script
at script.run(script:68)
at javaposse.jobdsl.dsl.DslScriptLoader.runDslEngineForParent(DslScriptLoader.java:75)
... 68 more
I think you need to add some time limit for job executions.
javaposse.jobdsl.dsl.DslFactory.package.implementationVersion
is no longer working since i upgraded and switched to fat jar. I've hardcoded for now, but should figure out how to pass that to the app.
Hey @sheehan, thanks for the Job DSL playground! Assuming you wish to do so, would you mind adding an open source license and/or copyright statement to this project?
Thanks!
The following github branch source plugin DSL does not seem to work.
multibranchPipelineJob('./RIA/ria-jsonify-svc/ria-jsonify-svc Pull Request Builder') {
description("Generic Pull Request Builder Job")
branchSources {
branchSource {
source {
github {
// Specifies a unique ID for this branch source.
id("1234567890")
}
}
}
}
factory {
workflowBranchProjectFactory {
scriptPath('jenkins/Jenkinsfile-PullRequest.groovy')
}
}
orphanedItemStrategy {
discardOldItems {
numToKeep(20)
}
}
}
App does load
Following the documentation about deprecating concurrentBuild it seems that even the Playground does not work with the example given in the documentation:
pipelineJob('example-1') {
properties {
disableConcurrentBuilds()
}
}
It states that the Job-DSL Version is 1.76 so the example above should work, but instead it results in
javaposse.jobdsl.dsl.DslScriptException: (script, line 3) No signature of method: javaposse.jobdsl.dsl.helpers.properties.PropertiesContext.disableConcurrentBuilds() is applicable for argument types: () values: []
Narrative:
As a Jenkins DSL user, I want to be able to lint my DSL job updates offline, so that I can both script my static code analyses for infrastructure code and evaluate my code from behind company firewall securely.
Acceptance Criteria:
Scenario: Export Linter to command line tool
User: Infrastructure engineer or equivalent automation
GIVEN a DSL script
WHEN I run the DSL Playground linter via command line
THEN I want to validate the physical structure of my DSL job in a way that mimics the results/output of the web application UI
Scenario: Checking Groovy imports for DSL
User: Infrastructure engineer or equivalent automation
GIVEN: a DSL script AND Groovy imports included
WHEN I run the DSL Playground linter via command line OR via UI
THEN I want to validate the physical structure of my DSL job even if it utilizes downstream Groovy dependencies
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.