Browse Source

cleaning up automation logs URLs

master
forest 2 years ago
parent
commit
f0501ff560
  1. 16
      main.go

16
main.go

@ -140,7 +140,7 @@ func main() {
func() automation.TaskResult {
// Add 1 to the build number, each time rootsystem runs is a different build.
file, notFound, err := global.storage.Get("rootsystem/terraform-logs/build-number.txt")
file, notFound, err := global.storage.Get("rootsystem/automation/build-number.txt")
if err != nil && !notFound {
return automation.TaskResult{
Name: "buildNumber",
@ -156,7 +156,7 @@ func main() {
buildNumber = n + 1
}
}
err = global.storage.Put("rootsystem/terraform-logs/build-number.txt", []byte(strconv.Itoa(buildNumber)))
err = global.storage.Put("rootsystem/automation/build-number.txt", []byte(strconv.Itoa(buildNumber)))
if err != nil {
return automation.TaskResult{
Name: "buildNumber",
@ -234,10 +234,10 @@ func main() {
fmt.Println("DockerComposeUp kicked off")
diagramPath := fmt.Sprintf(
"rootsystem/docker-compose-logs/%d/diagram.svg", buildNumber,
"rootsystem/automation/%04d/docker-compose-%s/diagram.svg", buildNumber, config.Host.Name,
)
statusPath := fmt.Sprintf(
"rootsystem/docker-compose-logs/%d/status.json", buildNumber,
"rootsystem/automation/%04d/docker-compose-%s/status.json", buildNumber, config.Host.Name,
)
success, err := streamUpdatesToObjectStorage(diagramPath, svg, statusPath, statusChannel)
@ -279,12 +279,12 @@ func terraformBuild(
fmt.Println("TerraformPlanAndApply kicked off")
diagramPath := fmt.Sprintf(
"rootsystem/terraform-logs/%s/%d/diagram.svg",
terraformConfig.TerraformProject, terraformConfig.BuildNumber,
"rootsystem/automation/%04d/%s/diagram.svg",
terraformConfig.BuildNumber, terraformConfig.TerraformProject,
)
statusPath := fmt.Sprintf(
"rootsystem/terraform-logs/%s/%d/status.json",
terraformConfig.TerraformProject, terraformConfig.BuildNumber,
"rootsystem/automation/%04d/%s/status.json",
terraformConfig.BuildNumber, terraformConfig.TerraformProject,
)
success, err := streamUpdatesToObjectStorage(diagramPath, svg, statusPath, statusChannel)

Loading…
Cancel
Save