parent
eb5b2c8d23
commit
d88b75988e
15
.drone.yml
15
.drone.yml
@ -16,8 +16,9 @@ steps:
|
|||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
repo: dutchellie/proper-website-2
|
repo: dutchellie/proper-website-2
|
||||||
|
target: staging
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- dev
|
||||||
- ${DRONE_COMMIT_SHA:0:8}
|
- ${DRONE_COMMIT_SHA:0:8}
|
||||||
- name: deploy-staging
|
- name: deploy-staging
|
||||||
image: pelotech/drone-helm3
|
image: pelotech/drone-helm3
|
||||||
@ -54,6 +55,18 @@ trigger:
|
|||||||
- production
|
- production
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: docker
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
repo: dutchellie/proper-website-2
|
||||||
|
target: production
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
- ${DRONE_COMMIT_SHA:0:8}
|
||||||
- name: deploy-production
|
- name: deploy-production
|
||||||
image: pelotech/drone-helm3
|
image: pelotech/drone-helm3
|
||||||
settings:
|
settings:
|
||||||
|
11
Dockerfile
11
Dockerfile
@ -5,11 +5,20 @@ RUN go mod tidy
|
|||||||
RUN GOARCH=wasm GOOS=js go build -o web/app.wasm
|
RUN GOARCH=wasm GOOS=js go build -o web/app.wasm
|
||||||
RUN go build -o app
|
RUN go build -o app
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest AS staging
|
||||||
RUN apk --no-cache add ca-certificates
|
RUN apk --no-cache add ca-certificates
|
||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
COPY --from=builder /project/web ./web/
|
COPY --from=builder /project/web ./web/
|
||||||
COPY --from=builder /project/app ./
|
COPY --from=builder /project/app ./
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
ENV TESTING = true
|
||||||
CMD ["./app"]
|
CMD ["./app"]
|
||||||
|
|
||||||
|
FROM alpine:latest AS production
|
||||||
|
RUN apk --no-cache add ca-certificates
|
||||||
|
WORKDIR /root/
|
||||||
|
COPY --from=builder /project/web ./web/
|
||||||
|
COPY --from=builder /project/app ./
|
||||||
|
EXPOSE 8000
|
||||||
|
ENV TESTING = false
|
||||||
|
CMD ["./app"]
|
@ -4,6 +4,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"dutchellie.nl/DutchEllie/proper-website-2/entity"
|
"dutchellie.nl/DutchEllie/proper-website-2/entity"
|
||||||
@ -47,6 +48,9 @@ func (g *guestbookPanel) Render() app.UI {
|
|||||||
func (g *guestbookPanel) LoadComments() {
|
func (g *guestbookPanel) LoadComments() {
|
||||||
// TODO: maybe you can put this in a localbrowser storage?
|
// TODO: maybe you can put this in a localbrowser storage?
|
||||||
url := apiurl + "api/comment"
|
url := apiurl + "api/comment"
|
||||||
|
if os.Getenv("TESTING") == "true" {
|
||||||
|
url = apiurl + "api/testingcomment"
|
||||||
|
}
|
||||||
res, err := http.Get(url)
|
res, err := http.Get(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
app.Log(err)
|
app.Log(err)
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
|
|
||||||
"dutchellie.nl/DutchEllie/proper-website-2/entity"
|
"dutchellie.nl/DutchEllie/proper-website-2/entity"
|
||||||
"github.com/maxence-charriere/go-app/v9/pkg/app"
|
"github.com/maxence-charriere/go-app/v9/pkg/app"
|
||||||
@ -48,6 +49,10 @@ func (p *Homepage) Render() app.UI {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
url := apiurl + "api/comment"
|
url := apiurl + "api/comment"
|
||||||
|
if os.Getenv("TESTING") == "true" {
|
||||||
|
url = apiurl + "api/testingcomment"
|
||||||
|
}
|
||||||
|
|
||||||
req, err := http.Post(url, "application/json", bytes.NewBuffer(jsondata))
|
req, err := http.Post(url, "application/json", bytes.NewBuffer(jsondata))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("err: %v\n", err)
|
fmt.Printf("err: %v\n", err)
|
||||||
|
@ -88,6 +88,7 @@ body {
|
|||||||
|
|
||||||
div .name {
|
div .name {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
div .date {
|
div .date {
|
||||||
@ -99,6 +100,7 @@ div .date {
|
|||||||
|
|
||||||
.comment-message {
|
.comment-message {
|
||||||
color:white;
|
color:white;
|
||||||
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gb-modal {
|
.gb-modal {
|
||||||
|
Loading…
Reference in New Issue
Block a user