-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
41 lines (32 loc) · 1.33 KB
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
echo ">>> Environment vars"
echo _SERVICE_ACCOUNT: $_SERVICE_ACCOUNT
echo ">>> Delete build folder"
rm -rf build
echo ">>> Create build folder and subfolders"
mkdir build
mkdir build/src
mkdir build/src/parrao_weather_bot
echo ">>> Copy files to build/src/parrao_weather_bot"
cp -R main.py build/src
cp -R parrao_weather_bot build/src
# Local execution
#export _SERVICE_ACCOUNT=cloud--functions@dev-bbva-work-space-booking-sp.iam.gserviceaccount.com
echo ">>> Folder content parrao_weather_bot:"
ls build/src/parrao_weather_bot
echo ">>> Deploy parrao-weather-bot Cloud Functions. Current folder:"
cd build/src/parrao_weather_bot
pwd
gcloud functions deploy cercedilla-weather-bot --region=europe-west1 \
--runtime=python37 --entry-point=parrao_weather_bot --memory=128MB --timeout=120s \
# --env-vars-file ./credentials.yaml \ # This file doesn't upload to GitHub
--service-account=$_SERVICE_ACCOUNT \
--trigger-http --source=.
gcloud functions deploy cercedilla-weather-daily-bot --region=europe-west1 \
--runtime=python37 --entry-point=parrao_weather_bot_daily --memory=128MB --timeout=120s \
# --env-vars-file ./credentials.yaml \ # This file doesn't upload to GitHub
--service-account=$_SERVICE_ACCOUNT \
--trigger-http --source=.
echo ">>> Clean and delete build folder"
cd ../../..
rm -rf build