Change resume path to be within static directory, update submodules during static webhook updates
This commit is contained in:
parent
6d322baeaf
commit
2372455e22
7
main.go
7
main.go
|
@ -182,7 +182,6 @@ func startServer(srv *http.Server) {
|
|||
serveMux.HandleFunc("/", rootHandler)
|
||||
//serveMux.Handle("/certbot/", http.StripPrefix("/certbot/", http.FileServer(http.Dir("./certbot-tmp"))))
|
||||
serveMux.Handle("/gfm/", http.StripPrefix("/gfm", http.FileServer(gfmstyle.Assets)))
|
||||
serveMux.Handle("/resume/", http.StripPrefix("/resume", http.FileServer(http.Dir("resume/"))))
|
||||
serveMux.Handle("/resize/", Cache(Resize(640, http.StripPrefix("/resize", http.FileServer(http.Dir("static/"))))))
|
||||
serveMux.HandleFunc("/main.css", func(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "main.css") })
|
||||
if webhookKey != nil {
|
||||
|
@ -229,10 +228,14 @@ func startServer(srv *http.Server) {
|
|||
}
|
||||
// TODO parse payload
|
||||
|
||||
pullCmd := exec.Command("git", "pull")
|
||||
pullCmd := exec.Command("git", "pull", "--recurse-submodules")
|
||||
pullCmd.Dir = "./static/"
|
||||
_ = pullCmd.Run()
|
||||
|
||||
updateCmd := exec.Command("git", "submodule", "update", "--remote")
|
||||
updateCmd.Dir = "./static/"
|
||||
_ = updateCmd.Run()
|
||||
|
||||
w.Write([]byte("success"))
|
||||
})
|
||||
}
|
||||
|
|
2
static
2
static
|
@ -1 +1 @@
|
|||
Subproject commit ef94b776f38baf395f9e4ceaa98c1be286578115
|
||||
Subproject commit ded137546cc8b0ed3f27fd3f01b8a04172e6425c
|
Loading…
Reference in New Issue