Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy UDMI cloud functions with gcloud #275

Merged
merged 3 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions dashboard/.gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file specifies files that are *not* uploaded to Google Cloud
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

node_modules
File renamed without changes.
28 changes: 28 additions & 0 deletions dashboard/deploy_dashboard_gcloud
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash -e

if [ $# != 1 ]; then
echo Usage: $0 [project_id]
false
fi

ROOT=$(realpath $(dirname $0)/..)
cd $ROOT/dashboard

PROJECT=$1
shift

RUNTIME=nodejs12
SOURCE=functions/

version=`git describe --dirty`
echo Deploying version $version to $PROJECT
echo "const udmi_deploy_version = '$version';" > public/deploy_version.js

PUBSUB_FUNCTIONS="udmi_target udmi_state udmi_config udmi_reflect"
for func in $PUBSUB_FUNCTIONS; do
echo Deploying pubsub-trigger function $func...
gcloud functions deploy $func --trigger-topic=$func --runtime=$RUNTIME --project=$PROJECT --source=$SOURCE
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this for now but is there a way to make one atomic deploy, and/or do we want to stop deploying if any one deploy fails?

done

echo Skipping deploy of udmi_config b/c it requires firebase.
echo Done with deploying functions $PUBSUB_FUNCTIONS
16 changes: 16 additions & 0 deletions dashboard/functions/.gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file specifies files that are *not* uploaded to Google Cloud
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

node_modules