Setting Up Google Cloud Run
Last updated
Last updated
Download files from the Github repository to your computer
Sign up for a Github account
Install Git ()
Establish authentication to Github API
Windows
download VSCode
download the Github Pull Requests Extension
Click Accounts (bottom left) > sign in with Github
All Git commands need to be done in VSCode's in-built terminal
MacOS
Use VSCode, as above
Alternatively, use a Personal Access Token
Log into Github > Profile photo (top right) > Settings > Developer Settings (left menu, scroll down) > Personal access tokens > Tokens (classic) > Generate new token (top right) > Generate a new token (classic)
Give name, expiration date, and scopes (for scopes, click "repo")
Click Generate token
When you run git clone
(Step 2), it will ask for username and password. Use your Github username. For password, use the generated token.
Cache token with git config --global credential.helper osxkeychain
view cached credentials with echo url=https://github.com/git/git.git | git credential fill
In your CLI, cd into where you want the “trading-view-automation” folder downloaded, then run git clone https://github.com/brianonchain/trading-view-automation.git
Prompt will pop up > login with browser
After the credentials are confirmed, the folder containing the files will downloaded
Repo is only downloadable if you are invited as a collaborator to the private repo
Upload files to Google Cloud Run
Sign up an account on Google Cloud Platform
Create a billing account
Create a project
Install the Google Cloud CLI, takes ~10 minutes ()
In your CLI:
cd into the “trading-view-automation” folder you created in Step 1.3.4
gcloud init
Enter 1
for "Re-initialize this configuration [default] with new settings"
Login with your Google username/password
Select the project you created in Step 2.3
gcloud run deploy --source .
For the Service name, press Enter
to use the default name ("trading-view-automation")
enter y
to enable APIs
Choose region
Enter y
to allow unauthenticated invocations
Wait ~5 minutes for files to build & upload
Enter your environment variables
Select your project in Google Cloud
Click the menu (top left) > Cloud Run > click the trading-view-automation Service
Click EDIT & DEPLOY NEW REVISION (top)
Under Edit Container, click VARIABLES & SECRETS and enter environment variables (see )
For better security, you can use Google Secrets Manager. For the best security, you can use Google Key Management Service (see )
Copy the app URL and use it as the webhook URL in your or
URL is located in menu (top left) > Cloud Run > click the trading-view-automation Service > see top-middle of page (it looks like )
If you need to update the Cloud Run code
cd into "trading-view-automation folder", ensure you are on "main" branch, run git pull
Follow Step 2.5.3
Set up Google Sheets to see successful or failed trades (see )
Set up Telegram to see successful or failed trades (see )
Send a or mimic one using . Use the provided Heroku HTTPS URL (see Step 1.4) as the webhook URL.