/cloudfunctions

Bandera Blanca - Cloud functions

Primary LanguageGo

Bandera Blanca - Cloud Functions

Requirements

  • Google Cloud SDK
  • GO
  • Firebase admin SDK to GO

First steps

Install Google Cloud SDK

To get gcloud to see here

Install GO sdk

  1. Donwload sdk according to your operating system here

  2. Add GO to path

  • If you have Linux, you can edit at vim ~/.profile and add the next line
export PATH=$PATH:/usr/local/go/bin

and also

export GOPATH=$HOME/{Folder Route, where your GO projects will be}
  • Run, to use GO Modules
$ echo "export GO111MODULE=on" >> ~/.bash_profile

Install Firebase admin SDK to GO

$ go get -u firebase.google.com/go

Download Project and go to folder cloudfunctions

$ git clone git@github.com:banderablanca/cloudfunctions.git
$ cd cloudfunctions

Get & update dependencies

$ go get
$ go mod tidy

Deploy functions

  1. To select project run:
$ gcloud config set project {projectID}
  1. At the root of the project run:
$ go get
  1. After run:
$ bash run.sh {projectID} 
  1. Deploy finished!