44 lines
1.7 KiB
Go
44 lines
1.7 KiB
Go
package main
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"encoding/json"
|
||
|
|
"flag"
|
||
|
|
"fmt"
|
||
|
|
"os"
|
||
|
|
|
||
|
|
"data-terminal-cloud/internal/releaseevidence"
|
||
|
|
)
|
||
|
|
|
||
|
|
type repeatedStringFlag []string
|
||
|
|
|
||
|
|
func (value *repeatedStringFlag) String() string { return fmt.Sprint([]string(*value)) }
|
||
|
|
func (value *repeatedStringFlag) Set(input string) error {
|
||
|
|
*value = append(*value, input)
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func main() {
|
||
|
|
root := flag.String("root", ".", "project root")
|
||
|
|
candidateVersion := flag.String("candidate-version", "", "candidate version")
|
||
|
|
buildDigest := flag.String("build-digest", "", "sha256 image or immutable build digest")
|
||
|
|
sourceCommit := flag.String("source-commit", "", "source commit; LAB may use an explicit local label")
|
||
|
|
acceptanceSnapshot := flag.String("acceptance-snapshot", "", "technical acceptance snapshot JSON")
|
||
|
|
evidenceIndex := flag.String("evidence-index", "", "external evidence index JSON")
|
||
|
|
var pilotDailySnapshots repeatedStringFlag
|
||
|
|
flag.Var(&pilotDailySnapshots, "pilot-daily-snapshot", "PILOT daily snapshot JSON; repeat exactly seven times for a PILOT bundle")
|
||
|
|
pilotWeeklySnapshot := flag.String("pilot-weekly-snapshot", "", "completed PILOT weekly snapshot JSON")
|
||
|
|
output := flag.String("out", "", "output ZIP path")
|
||
|
|
flag.Parse()
|
||
|
|
result, err := releaseevidence.Build(releaseevidence.Options{
|
||
|
|
Root: *root, CandidateVersion: *candidateVersion, BuildDigest: *buildDigest, SourceCommit: *sourceCommit,
|
||
|
|
AcceptanceSnapshotPath: *acceptanceSnapshot, EvidenceIndexPath: *evidenceIndex,
|
||
|
|
PilotDailySnapshotPaths: []string(pilotDailySnapshots), PilotWeeklySnapshotPath: *pilotWeeklySnapshot, OutputPath: *output,
|
||
|
|
})
|
||
|
|
if err != nil {
|
||
|
|
fmt.Fprintln(os.Stderr, "release evidence bundle failed:", err)
|
||
|
|
os.Exit(1)
|
||
|
|
}
|
||
|
|
encoded, _ := json.Marshal(result)
|
||
|
|
fmt.Println(string(encoded))
|
||
|
|
}
|