Sha256: 2ceee765f135186217132651f89386b22e2581caaa0a2650eaa8c87f41592d1f

Contents?: true

Size: 1.31 KB

Versions: 6

Compression:

Stored size: 1.31 KB

Contents

# frozen_string_literal: true

resource :rudder_git, :git do
  # The source field dictionary is available to be directly interacted with
  source[:uri]    = 'https://github.com/jhmcstanton/rudder.git'
  source[:branch] = 'master'
end

resource :timer, :time do
  # The source field can also be assigned via a method
  source(interval: '5m')
end

job :getter do
  plan [in_parallel: [{ get: :rudder_git }, { get: :timer, trigger: true }]]
end

job :hello_world do
  # Plan array can be hooked into directly
  plan << { get: :timer, trigger: true, passed: [:getter] }
  plan << { task: 'print_hello', config: {
    platform: 'linux',
    image_resource: { type: 'docker-image', source: { repository: 'busybox' } },
    run: {
      path: 'echo',
      args: ['Hello', 'World!']
    }
  } }
end

# pipeline here allows access to previously defined pipeline components
job :cat_self do |pipeline|
  # The plan can also be appended to as a method
  plan({ get: :rudder_git, trigger: true, passed: [:getter] },
       task: 'cat this pipeline', config: {
         inputs: [name: :rudder_git],
         platform: 'linux',
         image_resource: { type: 'docker-image', source: { repository: 'busybox' } },
         run: {
           path: 'cat',
           args: [pipeline.rudder_git.sub_path('examples/hello_world.rb')]
         }
       })
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rudder-0.3.1 examples/hello_world_pipeline.rb
rudder-0.3.0 examples/hello_world_pipeline.rb
rudder-0.2.2 examples/hello_world_pipeline.rb
rudder-0.2.1 examples/hello_world_pipeline.rb
rudder-0.2.0 examples/hello_world_pipeline.rb
rudder-0.1.0 examples/hello_world_pipeline.rb