How to upload a Google App Engine (Go) project in a different folder than the app.yaml -


my project has following structure:

| appengine |---- app.yaml |---- myscript.go | bower_components |----|... | build |----|images |----|----|branding |----|----|---- favicon.ico |----|styles |----|----|*.css |----|index.html | src | ... 

i upload entire content of build folder when running goapp deploy appengine.

my app.yaml looks this:

application: myproject version: 0-1 runtime: go api_version: go1  handlers: - url: /(.*\.(gif|png|jpg|ico|js|css))   static_files: ../build/\1   upload: ../build/(.*\.(gif|png|jpg|ico|js|css))  - url: /.*   script: _go_app 

and myscript.go looks this:

package myproject  import (     "fmt"     "io/ioutil"     "net/http" )  func init() {     http.handlefunc("/", handler) }  func handler(w http.responsewriter, r *http.request) {     site, err := ioutil.readfile("../build/index.html")      if err != nil {         panic(err)     }      fmt.fprint(w, string(site)) } 

when run goapp serve appengine, website displays properly. however, when try deploy it, clones 2 files, i.e. ones inside appengine folder.

you can preserve desired app structure 3rd party code residing outside gae app code directory yet still able upload 3rd party code gae app code symlinking 3rd party code files/dirs inside gae app dir in desired locations.

the gae upload/deploy utilities know replace symlinks , upload actual files/dirs symlinks point instead, in respective locations.

some other gae-related scenarios in symlink technique can applied:


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -