diff --git a/artifacts/README.md b/artifacts/README.md new file mode 100644 index 0000000..5863c36 --- /dev/null +++ b/artifacts/README.md @@ -0,0 +1,2 @@ +## Artifacts directory + diff --git a/bacillus.go b/bacillus.go index 4d142c6..7c09cac 100644 --- a/bacillus.go +++ b/bacillus.go @@ -29,10 +29,13 @@ const ( ) var ( - addrPort string - hookStd string - apiKey string - attachStdout bool + server *http.Server + addrPort string + hookStd string + apiKey string + attachStdout bool + shutdownModeActive bool + killSwitch chan bool //statUseUnicode bool indStyle string instCounter uint32 @@ -59,6 +62,9 @@ func getFavIcon() string { } func getBodyBgndHTMLFrag() string { + if shutdownModeActive { + return ` style='background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%,rgba(0,0,0,0.8) 100%); background-image: url("/images/bacillus-shutdown.jpg"); background-size: cover;'` + } return ` style='background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%,rgba(0,0,0,0.8) 100%); background-image: url("/images/bacillus.jpg"); background-size: cover;'` } @@ -342,6 +348,13 @@ func launchJobListener(mainCtx context.Context, jobTag, jobOpts string, jobEnv [
`) + if shutdownModeActive { + io.WriteString(w, fmt.Sprintf("Server is in shutdown mode, come back later.\n")) + io.WriteString(w, ` + +