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

Feature/update cronjob name #103

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions logpush-to-bigquery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ TABLE="" # optional – BigQuery table to write to. Will be created if necessary
FN_NAME="" # optional - the name of your Cloud Function | default: gcsbq
# optional - the name of the pubsub topic that will be published every minute
TOPIC_NAME=""
CRON_JOB_NAME="" # optional - name of the cron job that is being created.
# Deploy to GCP
sh ./deploy.sh
```
4 changes: 4 additions & 0 deletions logpush-to-bigquery/cloudshell.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ FN_NAME=""
# optional - the name of the pubsub topic that will be published every minute
TOPIC_NAME="every_minute"

# optional - name of the cron job that is being created.
CRON_JOB_NAME=""


```

## Deploy to GCP
Expand Down
3 changes: 2 additions & 1 deletion logpush-to-bigquery/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ REGION="us-central1"
# You probably don't need to change these values:
FN_NAME="cf-logs-to-bigquery"
TOPIC_NAME="every_minute"
CRON_JOB_NAME="cf_logs_cron"

# Create pubsub topic
gcloud pubsub topics create $TOPIC_NAME
# Create cron job
gcloud scheduler jobs create pubsub cf_logs_cron --schedule="* * * * *" --topic=$TOPIC_NAME --message-body="60 seconds passed"
gcloud scheduler jobs create pubsub $CRON_JOB_NAME --schedule="* * * * *" --topic=$TOPIC_NAME --message-body="60 seconds passed"
# Deploy function
gcloud functions deploy $FN_NAME \
--runtime nodejs12 \
Expand Down