Explorar el Código

enable production config and debug config. allow debug to use any webroot.

master
sp hace 4 años
padre
commit
fbb08b61f0
Se han modificado 3 ficheros con 37 adiciones y 2 borrados
  1. +1
    -1
      config.json
  2. +31
    -0
      deploy/config_production.json
  3. +5
    -1
      deploy/deploy.sh

+ 1
- 1
config.json Ver fichero

"Debug": true, "Debug": true,
"Static": [ "Static": [
{ {
"Dir": "./html/",
"Dir": "/mnt/hgfs/workspace/2021-07-31-BiukopWeb",
"StaticUrl": "/", "StaticUrl": "/",
"StripPrefix" : "/" "StripPrefix" : "/"
}, },

+ 31
- 0
deploy/config_production.json Ver fichero

{
"Host":"0.0.0.0",
"Port":"8080",
"DSN": "sp:sp@tcp(192.168.1.70:3306)/syd_credit?parseTime=true&loc=Australia%2FSydney&collation=utf8mb4_0900_ai_ci",
"TlsCert": "cert/fullchain.pem",
"TlsKey": "cert/privkey.pem",
"Debug": true,
"Static": [
{
"Dir": "./html/",
"StaticUrl": "/",
"StripPrefix" : "/"
},
{
"Dir": "./html/test/",
"StaticUrl": "/spa1/",
"StripPrefix" : "/spa1/"
},
{
"Dir": "./html/test/",
"StaticUrl": "/spa2/",
"StripPrefix" : "/spa2/"
}
],
"Session" : {
"Guest": true,
"Year": 10,
"Month": 1,
"Day": 1
}
}

+ 5
- 1
deploy/deploy.sh Ver fichero

mkdir -p /tmp/goweb mkdir -p /tmp/goweb
echo "prepare golang project" echo "prepare golang project"
rsync -a $PROJ_DIR /tmp/goweb/ rsync -a $PROJ_DIR /tmp/goweb/
rm -rf /tmp/goweb/html/*
cp -f $PROJ_DIR/deploy/config_production.json /tmp/goweb/config.json
rm -rf /tmp/goweb/html/css
rm -rf /tmp/goweb/html/test
rm -rf /tmp/goweb/html/*.html
echo "sync Web html" echo "sync Web html"
rsync -a /mnt/hgfs/workspace/2021-07-31-BiukopWeb/ /tmp/goweb/html/ rsync -a /mnt/hgfs/workspace/2021-07-31-BiukopWeb/ /tmp/goweb/html/



cd /tmp/goweb cd /tmp/goweb
gcloud app deploy gcloud app deploy



Cargando…
Cancelar
Guardar