0

I've been trying to deploy my go app on Google App Engine but I'm a bit stuck on how to make it include my seed-data files from a relative directory.
Project structure is:

- project
 |- cmd
 |    |- main.go
 |    |- app.yaml
 |
 |- seed-data
      |- foo.json

It works fine if I put foo.json next to main.go & app.yaml but how to I keep the structure and configure it to include the seed file from ../seed-data/foo.json?

TommyF
  • 6,660
  • 8
  • 37
  • 61

1 Answers1

1

The directory in which the app.yaml file exists is considered the top level directory for the respective GAE app service. Only what is below this top level service directory will be deployed to GAE.

In your case the seed-data directory is above the service's top level dir, so it won't be considered part of the service code at deployment. You need to address that.

If you're running in the standard environment it should be possible to use a properly located symlink to make the seed-data directory appear inside the service dir. See How to upload a Google App Engine (Go) project in a different folder than the app.yaml

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97