lambda functions to retrieve and process data for gitwize (commit data, PR data, file changes...)
pre-commit install
-
export USE_DEFAULT_API_TOKEN=***
-
export DEFAULT_GITHUB_TOKEN=***
-
export DB_CONN_STRING=***
Note that you can point DB_CONN_STRING to local/dev/prod directly, so be caution.
go run local/get_data_all_repos/main.go
go run local/load_metric_all_repos/main.go
go run local/get_data_single_repo/main.go [repo_id] [repo_name] [repo_url] [repo_pass]
for example:
go run local/get_data_single_repo/main.go 61 go-git https://github.com/go-git/go-git.git
go test -count=1 ./... -coverprofile cover.out; go tool cover -func cover.out
-
make sure
docker-compose up
is run fromgitwize-be
-
export GITWIZE_INTEGRATION_TEST="TRUE"
-
go test -count=1 ./... -coverprofile cover.out; go tool cover -func cover.out
Note that integration tests require and will affect local database. Integration tests always run during CI and be using for total coverage.
-
install serverless framework https://www.serverless.com/framework/docs/providers/aws/guide/quick-start/
-
install aws cli and config with aws credentials (user in aws iam
lambda
) and config regionap-southeast-1
-
build and deploy dev:
make && sls deploy --stage dev
-
build and deploy qa:
make && sls deploy --stage qa
- CircleCI build job will download
gitwize-be
and create mysql db for integration test - CircleCI deploy run similar command as deploy to cloud above