Sha256: d9abda516999eed1de3ea4f97431e5ba0aac100f11993b1898719a37113a230c

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

require_relative './common'
require_relative './buildstep/shell'
require_relative './buildstep/copyartifact'
require_relative './buildstep/inject_env'
require_relative './buildstep/ant'
require_relative './buildstep/xvfb'

module JenkinsJob
  class FreeStyle < Common::Common
    include BuildStep

    attr_reader :name, :workspace_, :builders_

    def initialize(name, builder)
      super(builder)
      @name = name
      @builders_ = []
    end

    def workspace(value)
      @workspace_ = value
    end

    def shell(cmd)
      @builders_ << Shell.new(cmd)
    end

    def batch(cmd)
      @builders_ << Batch.new(cmd)
    end

    def powershell(cmd)
      @builders_ << Powershell.new(cmd)
    end

    def inject_env(&block)
      inject = InjectEnv.new
      inject.instance_eval(&block) if block_given?

      @builders_ << inject
    end

    def xvfb(&block)
      xvfb = Xvfb.new
      xvfb.instance_eval(&block) if block_given?

      @wrappers_['xvfb'] = xvfb
    end

    def ant(&block)
      ant = Ant.new
      ant.instance_eval(&block) if block_given?

      @builders_ << ant
    end

    def copyartifact(artifact_job, &block)
      # sandbox for copy artifacts dsl
      copyartifact = CopyArtifact.new(artifact_job)
      copyartifact.instance_eval(&block)

      @builders_ << copyartifact
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rubyjobbuilderdsl-0.0.5 lib/rubyjobbuilderdsl/freestyle.rb
rubyjobbuilderdsl-0.0.3 lib/rubyjobbuilderdsl/freestyle.rb
rubyjobbuilderdsl-0.0.2 lib/rubyjobbuilderdsl/freestyle.rb
rubyjobbuilderdsl-0.0.1 lib/rubyjobbuilderdsl/freestyle.rb