WIP: continued server work. Schema for config files.
This commit is contained in:
		
							
								
								
									
										1
									
								
								api.rst
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								api.rst
									
									
									
									
									
								
							@@ -6,3 +6,4 @@ GET    /api/project/<proj-id>                     -- return detailed project rec
 | 
				
			|||||||
GET    /api/project/<proj-id>/<step-id>           -- return detailed step information (include runs)
 | 
					GET    /api/project/<proj-id>/<step-id>           -- return detailed step information (include runs)
 | 
				
			||||||
POST   /api/project/<proj-id>/<step-id>/run/<ref> -- kick off a run
 | 
					POST   /api/project/<proj-id>/<step-id>/run/<ref> -- kick off a run
 | 
				
			||||||
GET    /api/project/<proj-id>/<step-id>/run/<ref> -- return detailed run information
 | 
					GET    /api/project/<proj-id>/<step-id>/run/<ref> -- return detailed run information
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										41
									
								
								src/main/json/project.config.schema.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								src/main/json/project.config.schema.json
									
									
									
									
									
										Normal file
									
								
							@@ -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
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										50
									
								
								src/main/json/service.config.schema.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								src/main/json/service.config.schema.json
									
									
									
									
									
										Normal file
									
								
							@@ -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
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,5 +1,7 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "artifactsRepo": "artifacts",
 | 
					  "artifactsRepo": "artifacts",
 | 
				
			||||||
 | 
					  "users": [],
 | 
				
			||||||
 | 
					  "tokens": [],
 | 
				
			||||||
  "projects": [
 | 
					  "projects": [
 | 
				
			||||||
    { "name": "new-life-intro-band",
 | 
					    { "name": "new-life-intro-band",
 | 
				
			||||||
      "repo": "/home/jdb/projects/new-life-introductory-band" } ]
 | 
					      "repo": "/home/jdb/projects/new-life-introductory-band" } ]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user