mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-04-11 06:25:56 +02:00
Merge branch 'shyam' into shyam-frontend
This commit is contained in:
commit
7ce4bcc933
4
Makefile
4
Makefile
@ -36,6 +36,10 @@ $(TARGET): $(VAR) $(CFG) $(SVELTE_TARGETS)
|
|||||||
$(info ===> BUILD cc-backend)
|
$(info ===> BUILD cc-backend)
|
||||||
@go build -ldflags=${LD_FLAGS} ./cmd/cc-backend
|
@go build -ldflags=${LD_FLAGS} ./cmd/cc-backend
|
||||||
|
|
||||||
|
build:
|
||||||
|
$(info ===> BUILD cc-backend)
|
||||||
|
@go build -ldflags=${LD_FLAGS} ./cmd/cc-backend
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
$(info ===> BUILD frontend)
|
$(info ===> BUILD frontend)
|
||||||
cd web/frontend && npm install && npm run build
|
cd web/frontend && npm install && npm run build
|
||||||
|
@ -202,3 +202,9 @@ In case the REST or GraphQL API is changed the according code generators have to
|
|||||||
- [`gqlgen.yml`](https://github.com/ClusterCockpit/cc-backend/blob/master/gqlgen.yml) Configures the behaviour and generation of [gqlgen](https://github.com/99designs/gqlgen).
|
- [`gqlgen.yml`](https://github.com/ClusterCockpit/cc-backend/blob/master/gqlgen.yml) Configures the behaviour and generation of [gqlgen](https://github.com/99designs/gqlgen).
|
||||||
- [`startDemo.sh`](https://github.com/ClusterCockpit/cc-backend/blob/master/startDemo.sh) is a shell script that sets up demo data, and builds and starts `cc-backend`.
|
- [`startDemo.sh`](https://github.com/ClusterCockpit/cc-backend/blob/master/startDemo.sh) is a shell script that sets up demo data, and builds and starts `cc-backend`.
|
||||||
|
|
||||||
|
|
||||||
|
## Docker Mariadb
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -p 3306:3306 -detach --name some-mariadb --env MARIADB_DATABASE=clustercockpit --env MARIADB_ROOT_PASSWORD=my-secret-pw mariadb:latest
|
||||||
|
```
|
15
build.sh
Normal file
15
build.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
TARGET="./cc-backend"
|
||||||
|
VAR="./var"
|
||||||
|
CFG="config.json .env"
|
||||||
|
FRONTEND="./web/frontend"
|
||||||
|
VERSION="1.2.2"
|
||||||
|
GIT_HASH=$(git rev-parse --short HEAD || echo 'development')
|
||||||
|
CURRENT_TIME=$(date +"%Y-%m-%d:T%H:%M:%S")
|
||||||
|
LD_FLAGS="-s -X main.date=${CURRENT_TIME} -X main.version=${VERSION} -X main.commit=${GIT_HASH}"
|
||||||
|
|
||||||
|
echo ${LD_FLAGS}
|
||||||
|
|
||||||
|
# build.sh
|
||||||
|
go build -ldflags="${LD_FLAGS}" ./cmd/cc-backend
|
@ -337,7 +337,13 @@ func main() {
|
|||||||
rw.Header().Add("Content-Type", "text/html; charset=utf-8")
|
rw.Header().Add("Content-Type", "text/html; charset=utf-8")
|
||||||
web.RenderTemplate(rw, "privacy.tmpl", &web.Page{Title: "Privacy", Build: buildInfo})
|
web.RenderTemplate(rw, "privacy.tmpl", &web.Page{Title: "Privacy", Build: buildInfo})
|
||||||
})
|
})
|
||||||
// r.NotFoundHandler
|
|
||||||
|
r.NotFoundHandler = http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
rw.WriteHeader(http.StatusNotFound)
|
||||||
|
rw.Header().Add("Content-Type", "text/html; charset=utf-8")
|
||||||
|
web.RenderTemplate(rw, "404.tmpl", &web.Page{Title: "Page not found", Build: buildInfo})
|
||||||
|
})
|
||||||
|
-
|
||||||
|
|
||||||
secured := r.PathPrefix("/").Subrouter()
|
secured := r.PathPrefix("/").Subrouter()
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ const entrypoint = (name, path) => ({
|
|||||||
// we'll extract any component CSS out into
|
// we'll extract any component CSS out into
|
||||||
// a separate file - better for performance
|
// a separate file - better for performance
|
||||||
css({ output: `${name}.css` }),
|
css({ output: `${name}.css` }),
|
||||||
livereload('public')
|
// livereload('public')
|
||||||
],
|
],
|
||||||
watch: {
|
watch: {
|
||||||
clearScreen: false
|
clearScreen: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user