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:
- sharing entities between app engine modules
- how can share files (html templates) between app engine modules?
- do need copy `skip_files` across multiple yaml files?
- how access vendored library module in python google app engine?
- can default service/module in google app engine app sibling of non-default 1 in terms of folder structure?
Comments
Post a Comment