diff --git a/api.rst b/api.rst index 4dd82a4..06a1488 100644 --- a/api.rst +++ b/api.rst @@ -6,3 +6,4 @@ GET /api/project/ -- return detailed project rec GET /api/project// -- return detailed step information (include runs) POST /api/project///run/ -- kick off a run GET /api/project///run/ -- return detailed run information + diff --git a/src/main/json/project.config.schema.json b/src/main/json/project.config.schema.json new file mode 100644 index 0000000..ca54222 --- /dev/null +++ b/src/main/json/project.config.schema.json @@ -0,0 +1,41 @@ +{ + "title": "Strawboss project configuration schema", + "type": "object", + "properties": { + "name": "string", + "versionCmd": "string", + "steps": { + "title": "StepsCollection", + "type": "object", + "minProperties": 1, + "properties": { + "patternProperties": { + "^[\w-]+$": { + "type": "object", + "title": "StepDefinition", + "properties": { + "workingDir": "string", + "stepCmd": "string", + "artifacts": { + "type": "array", + "items": "string" }, + "cmdInput": { + "type": "array", + "items": "string" }, + "depends": { + "type": "array", + "items": "string" }, + "expectedEnv": { + "type": "array", + "items": "string" }, + "dontCache": "bool", + "additionalProperties": false + } + } + } + } + }, + "required": ["name", "steps"], + "additionalProperties": false + } +} diff --git a/src/main/json/service.config.schema.json b/src/main/json/service.config.schema.json new file mode 100644 index 0000000..0e75c43 --- /dev/null +++ b/src/main/json/service.config.schema.json @@ -0,0 +1,50 @@ +{ + "title": "StrawBoss service configuration schema.", + "type": "object", + "properties": { + "artifactsRepo": "string", + "projects": { + "title": "ProjectsList", + "type": "array", + "items": { + "title": "ProjectDefinition", + "type": "object", + "properties": { + "name": "string", + "repo": "string", + "defaultBranch": "string", + "cfgFilePath": "string", + "envVars": { + "type": "object", + "patternProperties": { + "^[\w-]+$": "string" + } + }, + "required": ["name", "repo"], + "additionalProperties": false + } + } + }, + "users": { + "title": "UsersList", + "type": "array", + "items": { + "title": "UserDefinition", + "type": "object", + "properties": { + "username": "string", + "hashedPwd": "string" + }, + "required": ["username", "hashedPwd"], + "additionalProperties": false + } + }, + "tokens": { + "title": "TokensList", + "type": "array", + "items": "string" + }, + "required": ["artifactsRepo", "projects", "users", "tokens"], + "additionalProperties": false + } +} diff --git a/strawboss.nim b/src/main/nim/strawboss.nim similarity index 100% rename from strawboss.nim rename to src/main/nim/strawboss.nim diff --git a/strawboss.config.json b/strawboss.config.json index c20fbdd..563b967 100644 --- a/strawboss.config.json +++ b/strawboss.config.json @@ -1,5 +1,7 @@ { "artifactsRepo": "artifacts", + "users": [], + "tokens": [], "projects": [ { "name": "new-life-intro-band", "repo": "/home/jdb/projects/new-life-introductory-band" } ]