Remove the concept of named, identifiable runs.
StarBoss is meant for building things checked into the repo It is also designed around repeatable builds. So it makes the assumption that running a build step for a specific version of a project will always result in the same output. So runs are identified by the project, build step, and version.
This commit is contained in:
@ -1,10 +1,9 @@
|
||||
import algorithm, asyncdispatch, bcrypt, cliutils, jester, json, jwt, logging,
|
||||
os, osproc, sequtils, strutils, tempfile, times, unittest, uuids
|
||||
os, osproc, sequtils, strutils, tempfile, times, unittest
|
||||
|
||||
import ./configuration, ./core
|
||||
|
||||
type Worker = object
|
||||
runId*: UUID
|
||||
process*: Process
|
||||
workingDir*: string
|
||||
|
||||
@ -77,11 +76,10 @@ proc spawnWorker(cfg: StrawBossConfig, req: RunRequest): Worker =
|
||||
|
||||
let dir = mkdtemp()
|
||||
var args = @["run", req.projectName, req.stepName, "-r", req.buildRef,
|
||||
"-w", dir, "-c", cfg.filePath, "-i", $req.id]
|
||||
"-w", dir, "-c", cfg.filePath]
|
||||
if req.forceRebuild: args.add("-f")
|
||||
debug "Launching worker: " & cfg.pathToExe & " " & args.join(" ")
|
||||
result = Worker(
|
||||
runId: req.id,
|
||||
process: startProcess(cfg.pathToExe, ".", args, loadEnv(), {poUsePath}),
|
||||
workingDir: dir)
|
||||
|
||||
@ -267,14 +265,6 @@ proc start*(cfg: StrawBossConfig): void =
|
||||
#resp($(%statuses), JSON)
|
||||
resp(Http501, makeJsonResp(Http501), JSON)
|
||||
|
||||
get "/project/@projectName/runs/@runId":
|
||||
## Details for a specific run
|
||||
|
||||
checkAuth(); if not authed: return true
|
||||
|
||||
# TODO
|
||||
resp(Http501, makeJsonResp(Http501), JSON)
|
||||
|
||||
get "/project/@projectName/step/@stepName":
|
||||
## Get step details including runs.
|
||||
|
||||
@ -297,7 +287,6 @@ proc start*(cfg: StrawBossConfig): void =
|
||||
checkAuth(); if not authed: return true
|
||||
|
||||
let runRequest = RunRequest(
|
||||
id: genUUID(),
|
||||
projectName: @"projectName",
|
||||
stepName: @"stepName",
|
||||
buildRef: if @"buildRef" != "": @"buildRef" else: nil,
|
||||
|
Reference in New Issue
Block a user