diff --git a/Cargo.lock b/Cargo.lock index f3c0446..38918ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1999,6 +1999,10 @@ dependencies = [ "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "travis-ci" +version = "0.1.0" + [[package]] name = "trust-dns-proto" version = "0.18.0-alpha.2" diff --git a/Cargo.toml b/Cargo.toml index 5bfef08..ab217ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,4 +3,5 @@ members = [ "auctioneer", "eventbus", + "processors/travis-ci", ] diff --git a/processors/README.adoc b/processors/README.adoc new file mode 100644 index 0000000..476507b --- /dev/null +++ b/processors/README.adoc @@ -0,0 +1,6 @@ += Otto Processors + + +Processors in Otto take configuration files, e.g. `.travis-ci.yml`, +`Jenkinsfile`, and convert them into the internal Otto constructs necessary for +task execution. diff --git a/processors/travis-ci/Cargo.toml b/processors/travis-ci/Cargo.toml new file mode 100644 index 0000000..2b72cbc --- /dev/null +++ b/processors/travis-ci/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "travis-ci" +version = "0.1.0" +authors = ["R. Tyler Croy "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/processors/travis-ci/example.internal.yml b/processors/travis-ci/example.internal.yml new file mode 100644 index 0000000..51a3052 --- /dev/null +++ b/processors/travis-ci/example.internal.yml @@ -0,0 +1,41 @@ +# +# This is an example of what the example.yml should convert to in terms of +# Otto's internal task execution structure +# +--- +meta: +# Tasks are a discrete higher level concept, which can be mapped to resources +# for execution +tasks: + - id: 0x1 + capabilities: + # "sudo false" basically means that the Travis workload doens't need a full + # virtual machine in order to operate + docker_run: true + # Operations should all exist in a single task and therefore run on a + # single colocated resource that has been allocated underneath + ops: + - id: 1 + # Contexts are typically going to carry environment variables and other + # things, in the simple Travis CI example, there's really a single + # "stage" (to use Jenkins terms) in which all scripts will be executed + type: BEGINCTX + data: + name: 'Travis' + - id: 2 + type: RUNPROC + data: + script: 'echo "Hello World"' + env: + # The Travis processor should set a default timeout + timeout_s: 300 + - id: 3 + type: RUNPROC + data: + script: 'env' + env: + timeout_s: 300 + - id: 4 + type: ENDCTX + data: + name: 'Travis' diff --git a/processors/travis-ci/example.yml b/processors/travis-ci/example.yml new file mode 100644 index 0000000..9ea7a92 --- /dev/null +++ b/processors/travis-ci/example.yml @@ -0,0 +1,10 @@ +# +# This is an example of a _very_ simple .travis-ci.yml file. + +--- +sudo: false +script: + - echo "Hello World" + - env + + diff --git a/processors/travis-ci/src/main.rs b/processors/travis-ci/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/processors/travis-ci/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}