Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
DaggerRuby is a Ruby SDK for Dagger, a programmable CI/CD engine. It allows developers to build powerful CI/CD pipelines using Ruby code instead of YAML configurations.
Sign in to like and favorite skills
DaggerRuby is a Ruby SDK for Dagger, a programmable CI/CD engine. It allows developers to build powerful CI/CD pipelines using Ruby code instead of YAML configurations.
DaggerRuby Module (
lib/dagger_ruby.rb)
connection methodClient (
lib/dagger_ruby/client.rb)
DaggerObject Base Class (
lib/dagger_ruby/dagger_object.rb)
id and chain_operationQueryBuilder (
lib/dagger_ruby/query_builder.rb)
# Operations are chained but not executed until a terminal method is called container = client.container .from("alpine:latest") .with_exec(["echo", "hello"]) # No execution yet result = container.stdout # Now it executes
client.container .from("ruby:3.2") .with_directory("/app", source_dir) .with_exec(["bundle", "install"]) .with_exec(["ruby", "app.rb"])
DAGGER_SESSION_PORT and DAGGER_SESSION_TOKEN environment variablesdagger run command if not in sessionDaggerRuby.connection do |client| client.container .from("alpine:latest") .with_exec(["apk", "add", "curl"]) .with_exec(["curl", "https://example.com"]) .stdout end
DaggerRuby.connection do |client| cache = client.cache_volume("my-cache") client.container .from("node:18") .with_mounted_cache("/root/.npm", cache) .with_exec(["npm", "install"]) end
DaggerRuby.connection do |client| source = client.git("https://github.com/user/repo.git") .branch("main") .tree client.container .from("node:18") .with_directory("/src", source) .with_exec(["npm", "run", "build"]) end
json, base64lib/ ├── dagger_ruby.rb # Main module ├── dagger_ruby/ │ ├── client.rb # HTTP/GraphQL client │ ├── query_builder.rb # Query construction │ ├── dagger_object.rb # Base class │ ├── container.rb # Container operations │ ├── directory.rb # Directory operations │ ├── file.rb # File operations │ ├── secret.rb # Secret management │ ├── cache_volume.rb # Cache volumes │ ├── host.rb # Host filesystem │ ├── git_repository.rb # Git operations │ ├── service.rb # Services │ ├── config.rb # Configuration │ ├── errors.rb # Error classes │ └── version.rb # Version constant
test/unit/test/integration/test/test_helper.rbConnectionError, GraphQLError, InvalidQueryError, HTTPErrorDaggerObject for new entity typesroot_field_name class methodchain_operation for fluent interfaceClient classexamples/cowsay.rb - Basic container usageexamples/ruby_app_build.rb - Ruby app with cachingexamples/dummy_app/ - Sample Sinatra applicationThis SDK provides a Ruby-native way to define CI/CD pipelines programmatically, leveraging Dagger's container-based execution engine.