Initial commit with some of the scaffolding I'm expecting to put into place

This commit is contained in:
R Tyler Croy 2020-08-03 17:23:53 -07:00
commit 2f03028f97
7 changed files with 1630 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

1520
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

14
Cargo.toml Normal file
View File

@ -0,0 +1,14 @@
[package]
name = "urci"
version = "0.1.0"
authors = ["R. Tyler Croy <rtyler@brokenco.de>"]
edition = "2018"
[dependencies]
async-std = { version = "~1.6.0", features = ["attributes"] }
cron = "~0.6.1"
serde = { version = "~1.0.106", features = ["rc"] }
serde_derive = "~1.0.106"
serde_json = "~1.0.0"
serde_yaml = "~0.8.13"
tide = "~0.13.0"

3
README.adoc Normal file
View File

@ -0,0 +1,3 @@
= UrCI
A most primitive CI server built as an exercise.

45
src/config.rs Normal file
View File

@ -0,0 +1,45 @@
/**
* This module contains all the defined structures which will process the UrCI
* configuration file
*/
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Config {
pub projects: Vec<Project>,
pub agents: Vec<Agent>,
pub handlers: Vec<Handler>,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Project {
name: String,
trigger: Trigger,
handler: String,
scm: Scm,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Trigger {
cron: Option<String>,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Scm {
git: Option<String>,
r#ref: Option<String>,
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Agent {
}
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Handler {
}

8
src/main.rs Normal file
View File

@ -0,0 +1,8 @@
#[macro_use]
extern crate serde_derive;
mod config;
fn main() {
println!("Hello, world!");
}

39
urci.yml Normal file
View File

@ -0,0 +1,39 @@
# This is an example configuration for urci
#
---
projects:
- name: hotdog
trigger:
cron: '*/10 * * * *'
# The different types of handlers should be documented elsewhere. In this
# case, the project is expected to use a simple .travis-ci.yml
handler: travis-ci
scm:
git: https://github.com/reiseburo/hotdog
ref: 'urci'
# Some agents must be defined in order to actually execute anything
agents:
- name: main
description: |
The primary instance running the urci server
# The local type can only be defined ones, since it will build projects on
# the primary urci server
type: local
- name: freebsd
description: |
A FreeBSD VM that exists just to run demo builds.
type: ssh
params:
username: 'urci'
password: 'urci'
hostname: freebsd-for-urci
handlers:
travis-ci:
filename: '.travis-ci.yml'
defaults:
agent: 'main'
timeout: 300