Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Create Makefile #330

Merged
merged 6 commits into from
Dec 4, 2021
Merged
Changes from 1 commit
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
53 changes: 53 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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:
Copy link
Member

Choose a reason for hiding this comment

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

what's the difference between install-cq, install-cq-mac (twice). I think we can get the OS and the arch automatically and put it in an env?

Copy link
Member

Choose a reason for hiding this comment

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

If we can't, how about mac-m1? Or how about this:

install-cq:
@echo Go to https://docs.cloudquery.io/install-instructions and do the thing there please

(ie. I'm questioning whether it's needed to have it here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I left install-cq target in there because that is what I use. I would love to support automatically detecting arch and os.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the instructions under this target. When we can support dynamic detection we can replace it with the automated install

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
roneli marked this conversation as resolved.
Show resolved Hide resolved
./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