Coder Social home page Coder Social logo

sheehan / job-dsl-playground Goto Github PK

View Code? Open in Web Editor NEW
88.0 8.0 33.0 1.44 MB

An app for debugging Groovy scripts using the Jenkins Job DSL

Home Page: http://job-dsl.herokuapp.com/

License: Apache License 2.0

Groovy 40.53% JavaScript 22.50% HTML 25.55% Dockerfile 0.49% Less 10.66% Procfile 0.26%
jenkins groovy job-dsl

job-dsl-playground's People

Contributors

daspilker avatar ewypych avatar gopisaba avatar jamietanna avatar kamilszymanski avatar onyon avatar sheehan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

job-dsl-playground's Issues

scm#git#cleanBeforeCheckout is wrong.

The Job dsl:

job('b') {
  scm {
            git('xxx.git', 'master') {
                extensions {
                    cleanBeforeCheckout()
                }
            }
        }
}

The xml result

<!-- 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>

Playground doesn't import hudson

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

dsl version

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.

License

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!

error processing github-branch-source-plugin DSL

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)
    }
  }
}

Migration Example concurrentBuild does not work in Playground with DSL-Plugin 1.76

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: []

New Feature Request: Command Line Linter for DSL

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.