Skip to content

Commit

Permalink
Merge pull request #6 from nkmr-jp/update-makefile
Browse files Browse the repository at this point in the history
🔧 Update Makefile
  • Loading branch information
nkmr-jp authored Sep 16, 2022
2 parents 4b66a3c + 1810e2d commit 4249c19
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.46.2
version: v1.49.0

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See:
# https://cloud.google.com/functions/docs/2nd-gen/getting-started#pubsub
# https://cloud.google.com/functions/docs/tutorials/pubsub
# https://cloud.google.com/storage/docs/lifecycle-configurations#delete-objects-json

REGION=asia-northeast1
Expand All @@ -9,7 +9,7 @@ PROJECT_NUMBER=$(shell gcloud projects list --filter="project_id:$(PROJECT_ID)"
FUNC_NAME=fetch
ENTRY_POINT=Fetch
TOPIC_NAME=$(FUNC_NAME)-topic
BUCKET_NAME=$(PROJECT_ID)-data-fetch
BUCKET_NAME=$(PROJECT_ID)-$(FUNC_NAME)
# VERSION=$(shell git rev-parse --short HEAD)
VERSION=$(shell git describe --abbrev=0 --tags)

Expand All @@ -29,7 +29,6 @@ init:
-gsutil lifecycle set ./lifecycle.json gs://$(BUCKET_NAME)-test
@echo
@echo "---- check resources in google cloud console. ----"
open https://console.cloud.google.com/iam-admin/serviceaccounts?project=$(PROJECT_ID)
open https://console.cloud.google.com/cloudpubsub/topic/detail/$(FUNC_NAME)-topic
open https://console.cloud.google.com/storage/browser?project=$(PROJECT_ID)

Expand All @@ -50,16 +49,17 @@ test:
export BUCKET_NAME=$(BUCKET_NAME)-test && go test -v

deploy:
gcloud beta functions deploy $(FUNC_NAME) \
gcloud functions deploy $(FUNC_NAME) \
--gen2 \
--runtime go116 \
--trigger-topic $(FUNC_NAME)-topic \
--entry-point $(ENTRY_POINT) \
--runtime=go116 \
--region=$(REGION) \
--trigger-topic=$(FUNC_NAME)-topic \
--entry-point=$(ENTRY_POINT) \
--set-env-vars BUCKET_NAME=$(BUCKET_NAME),VERSION=$(VERSION) \
--source .
--source=.

show:
gcloud beta functions describe $(FUNC_NAME) --gen2
gcloud functions describe $(FUNC_NAME) --gen2

URL=""
send:
Expand All @@ -72,7 +72,7 @@ endif
--message=$(URL)

log:
gcloud beta functions logs read $(FUNC_NAME) --gen2 --limit=100
gcloud functions logs read $(FUNC_NAME) --gen2 --limit=100

open:
open https://console.cloud.google.com/storage/browser?project=$(PROJECT_ID)
Expand Down
40 changes: 0 additions & 40 deletions file.go

This file was deleted.

0 comments on commit 4249c19

Please sign in to comment.