소스 검색

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

master
sp 4 년 전
부모
커밋
fbb08b61f0
3개의 변경된 파일37개의 추가작업 그리고 2개의 파일을 삭제
  1. +1
    -1
      config.json
  2. +31
    -0
      deploy/config_production.json
  3. +5
    -1
      deploy/deploy.sh

+ 1
- 1
config.json 파일 보기

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

+ 31
- 0
deploy/config_production.json 파일 보기

@@ -0,0 +1,31 @@
{
"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 파일 보기

@@ -7,10 +7,14 @@ echo "create /tmp/goweb"
mkdir -p /tmp/goweb
echo "prepare golang project"
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"
rsync -a /mnt/hgfs/workspace/2021-07-31-BiukopWeb/ /tmp/goweb/html/


cd /tmp/goweb
gcloud app deploy


Loading…
취소
저장