-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
39 lines (35 loc) · 995 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main
import (
"os"
"os/exec"
log "github.com/sirupsen/logrus"
)
func main() {
log.SetLevel(log.InfoLevel)
log.Infoln("started app successfully")
mConf := getMetadataConfig()
Metadataclient := connectMetadatas3(mConf)
log.Infof("Writing markdownfiles for respective XMLs")
metadataDownloader(Metadataclient)
markDownCreator()
hugo_cmd := exec.Command("hugo")
hugo_cmd.Dir = "./web/"
hugo_cmd.Stdout = os.Stdout
hugo_cmd.Stderr = os.Stderr
err := hugo_cmd.Run()
if err != nil {
log.Fatal(err)
}
log.Infof("Hugo successfully built")
pagefind_cmd := exec.Command("pagefind", "--site", "web/public/", "--output-path", "web/static/pagefind/")
pagefind_cmd.Stdout = os.Stdout
pagefind_cmd.Stderr = os.Stderr
pagefind_err := pagefind_cmd.Run()
if pagefind_err != nil {
log.Fatal(pagefind_err)
}
log.Infof("Pagefind modules successfully built")
dConf := getDeploymentConfig()
DeploymenClient := connectDeployments3(dConf)
staticSiteUploader(DeploymenClient)
}