Change resume path to be within static directory, update submodules during static webhook updates

This commit is contained in:
Kelvin Ly 2020-02-16 09:04:25 -05:00
parent 6d322baeaf
commit 2372455e22
2 changed files with 6 additions and 3 deletions

View File

@ -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

@ -1 +1 @@
Subproject commit ef94b776f38baf395f9e4ceaa98c1be286578115
Subproject commit ded137546cc8b0ed3f27fd3f01b8a04172e6425c