From 748b03217de14588eef9bcff9cc499f35ef18083 Mon Sep 17 00:00:00 2001 From: bbernays Date: Thu, 2 Dec 2021 16:49:09 -0500 Subject: [PATCH 1/5] Create Makefile --- Makefile | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..ca04ef492 --- /dev/null +++ b/Makefile @@ -0,0 +1,53 @@ +export CQ_PROVIDER_DEBUG=1 +export CQ_REATTACH_PROVIDERS=.cq_reattach + +# install the latest version of CQ +install-cq: + curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_Darwin_x86_64 -o cloudquery + chmod +x ./cloudquery + +install-cq-mac: + curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_Darwin_x86_64 -o cloudquery + chmod +x ./cloudquery + +install-cq-mac: + curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_Darwin_x86_64 -o cloudquery + chmod +x ./cloudquery + + +# build the cq aws provider +build: + go build -o cq-provider-aws + +# build and run the cq aws provider +run: build + ./cq-provider-aws + +# start a running docker container +start-pg: + docker run -p 5432:5432 -e POSTGRES_PASSWORD=pass -d postgres + +# stop a running docker container +stop-pg: + docker stop $$(docker ps -q --filter ancestor=postgres:latest) + +# connect to pg via cli +pg-connect: + psql -h localhost -p 5432 -U postgres -d postgres + + + +# Run an integration test +# you can pass in a specific test to run by specifying the testName: +# make testName=TestIntegrationElasticbeanstal e2e-test +e2e-test: + INTEGRATION_TESTS=1 TF_VAR_PREFIX=cq-testing TF_APPLY_RESOURCES=0 TF_VAR_SUFFIX=integration go test -timeout 30s -v -run ^$(testName)$$ github.com/cloudquery/cq-provider-aws/resources/integration_tests + +# Generate mocks for mock/unit testing +create-mocks: + go install github.com/golang/mock/mockgen + $(shell PATH=$$PATH:$$(go env GOPATH)/bin && go generate client/services.go) + +# Run a fetch command +fetch: + ./cloudquery fetch --dsn "postgres://postgres:pass@localhost:5432/postgres?sslmode=disable" -v From 9a4417e9bb84a8c5a10d61c0625f59a09b7b2273 Mon Sep 17 00:00:00 2001 From: bbernays Date: Fri, 3 Dec 2021 07:16:39 -0500 Subject: [PATCH 2/5] Update Makefile --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ca04ef492..3065622ed 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,7 @@ export CQ_REATTACH_PROVIDERS=.cq_reattach # install the latest version of CQ install-cq: - curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_Darwin_x86_64 -o cloudquery - chmod +x ./cloudquery + @echo Go to https://docs.cloudquery.io/install-instructions and do the thing there please install-cq-mac: curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_Darwin_x86_64 -o cloudquery From 8d1556bba58e1f80c745e4a8e671725c1c6b4a35 Mon Sep 17 00:00:00 2001 From: bbernays Date: Fri, 3 Dec 2021 09:13:28 -0500 Subject: [PATCH 3/5] Update Makefile --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3065622ed..51d59abbb 100644 --- a/Makefile +++ b/Makefile @@ -3,14 +3,14 @@ export CQ_REATTACH_PROVIDERS=.cq_reattach # install the latest version of CQ install-cq: - @echo Go to https://docs.cloudquery.io/install-instructions and do the thing there please + @echo Go to https://docs.cloudquery.io/install-instructions and follow install instructions for your specific machine install-cq-mac: curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_Darwin_x86_64 -o cloudquery chmod +x ./cloudquery -install-cq-mac: - curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_Darwin_x86_64 -o cloudquery +install-cq-linux: + curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_Linux_x86_64 -o cloudquery chmod +x ./cloudquery From 60548c19c8ff9dd0959711cfaf257d0aa231c18d Mon Sep 17 00:00:00 2001 From: bbernays Date: Fri, 3 Dec 2021 09:55:37 -0500 Subject: [PATCH 4/5] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 51d59abbb..9eec0dd1a 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ export CQ_REATTACH_PROVIDERS=.cq_reattach # install the latest version of CQ install-cq: - @echo Go to https://docs.cloudquery.io/install-instructions and follow install instructions for your specific machine + @echo Go to https://docs.cloudquery.io/docs/getting-started and follow install instructions for your specific machine install-cq-mac: curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_Darwin_x86_64 -o cloudquery From 0524a72bb8104967e3d93325d7505f2bc8c39475 Mon Sep 17 00:00:00 2001 From: bbernays Date: Fri, 3 Dec 2021 10:39:39 -0500 Subject: [PATCH 5/5] Make --- Makefile | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 9eec0dd1a..247817034 100644 --- a/Makefile +++ b/Makefile @@ -3,15 +3,10 @@ export CQ_REATTACH_PROVIDERS=.cq_reattach # install the latest version of CQ install-cq: - @echo Go to https://docs.cloudquery.io/docs/getting-started and follow install instructions for your specific machine - -install-cq-mac: - curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_Darwin_x86_64 -o cloudquery - chmod +x ./cloudquery - -install-cq-linux: - curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_Linux_x86_64 -o cloudquery - chmod +x ./cloudquery + @if [[ "$(OS)" != "Darwin" && "$(OS)" != "Linux" && "$(OS)" != "Windows" ]]; then echo "\n Invalid OS set. Valid Options are Darwin, Linux and Windows. Example invocation is:\n make OS=Linux ARCH=arm64 install-cq \n For more information go to https://docs.cloudquery.io/docs/getting-started \n"; exit 1; fi + @if [[ "$(ARCH)" != "x86_64" && "$(ARCH)" != "arm64" ]]; then echo "\n Invalid ARCH set. Valid options are x86_64 and arm64. Example invocation is:\n make OS=Linux ARCH=arm64 install-cq \n For more information go to https://docs.cloudquery.io/docs/getting-started \n"; exit 1; fi + curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_${OS}_${ARCH} -o cloudquery + chmod a+x cloudquery # build the cq aws provider