golang-standards / project-layout

Standard Go Project Layout
Other
49.73k stars 5.17k forks source link

Google App Engine deployment #13

Open DogAndHerDude opened 6 years ago

DogAndHerDude commented 6 years ago

What would be the approach to deploy the cmd/<name>/main.go structure to Google App Engine?

The regular command gcloud app deploy --project=<whatever> won't pick up that the main file is in another folder, and the entry file cannot be specified to the command.

I suppose the only hack-around would be to put the main.go in the base directory for deployment purposes? Feels dirty.

DuriDuri commented 6 years ago

+1

kcq commented 6 years ago

Would be good to have more information about your project... Can you share a bit more about your project structure? Is it an open source project?

You should be able to have your App Engine 'main' in a cmd/<name> directory... You might need to put your app.yaml file in the same directory though. Then run gcloud app deploy from cmd/<name>.

Here's a couple of examples that might help (the directory names are somewhat different, but the concept is the same):

The appengine and appenginevm build tags might also be useful if you want to have AppEngine and non-AppEngine versions of your service.