Starting to scope out a simple Travis CI processor

I need something to generate some simple tasks to pump into the eventbus for the
auctioneer, this will have to do
This commit is contained in:
R Tyler Croy 2020-01-12 14:23:37 -08:00
parent 22fef36da9
commit c93be57709
No known key found for this signature in database
GPG Key ID: E5C92681BEF6CEA2
7 changed files with 74 additions and 0 deletions

4
Cargo.lock generated
View File

@ -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"

View File

@ -3,4 +3,5 @@
members = [
"auctioneer",
"eventbus",
"processors/travis-ci",
]

6
processors/README.adoc Normal file
View File

@ -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.

View File

@ -0,0 +1,9 @@
[package]
name = "travis-ci"
version = "0.1.0"
authors = ["R. Tyler Croy <rtyler@brokenco.de>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View File

@ -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'

View File

@ -0,0 +1,10 @@
#
# This is an example of a _very_ simple .travis-ci.yml file.
---
sudo: false
script:
- echo "Hello World"
- env

View File

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}