gardenbuilder-app / gardenbuilder-backend-python

Django-based REST API
6 stars 11 forks source link

Set up way to automatically deploy to google cloud on commit #30

Closed capndave closed 3 years ago

capndave commented 3 years ago

Type

Feature request

Problem or To-Do

There needs to be a streamlined way to push this to Google Cloud when master is updated. I don't know the best, simple tool to do this so any input is appreciated. Ansible? A Bash script?

rexdivakar commented 3 years ago

I would love to work on it @capndave Also i would need the credentials to setup things on ur google cloud engine platform

capndave commented 3 years ago

@rexdivakar what's your email address? I'll see about giving you your own credentials for the bucket that this runs on, and the database. I have things set up for me to do quick deploys with gcloud app deploy, but that's not automated in any way.

rexdivakar commented 3 years ago

Pls respond once u mailed me @capndave rexdivakar@gmail.com

capndave commented 3 years ago

You should have just received an email from google

rexdivakar commented 3 years ago

yeah got it will raise a PR soon as i complete it

rexdivakar commented 3 years ago

Can u please assign it to my name also add a Hacktoberfest tag so its helpful for me !! @capndave

rexdivakar commented 3 years ago

I need access to ur github repo also permission to access it via google cloud for deploying it

image

capndave commented 3 years ago

Ok you should already have permission to deploy on google cloud and I just added you as a collaborator to this repo

capndave commented 3 years ago

You should be able to add this as a push stage routine in .pre-commit-config.yaml

rexdivakar commented 3 years ago

great will work on it now

rexdivakar commented 3 years ago

image Still i'm unable to get access can u pls check ?

capndave commented 3 years ago

@rexdivakar I looked into this today and due to the many permission-related steps required, I decided that I should go ahead and do it. So I did! Pushes to the master branch now deploy the app to google cloud. Thanks so much for working on this, I look forward to your other contributions! Next step is ensuring that the test suite and linting works correctly via Github Actions. I'll work on that as well.

capndave commented 3 years ago

@rexdivakar I figured out the basic flow for this, using Google Cloud Build. Unfortunately it requires that you hard-code environment variables/credentials into your app.yaml file, which I don't want to share on github. I guess I'll have to do deployments to production manually on my side :shrug: