Skip to content

Commit

Permalink
Replace vagrant setup with docker (closes #53)
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhanunlu committed Aug 17, 2020
1 parent cab2958 commit 6e4804a
Show file tree
Hide file tree
Showing 16 changed files with 310 additions and 125 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,3 @@ _testmain.go
# This project's binaries
build/
dist/

# Vagrant
.vagrant/
.release.yml.tmp
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sudo: required
language: go
services:
- docker
go:
- 1.13

Expand All @@ -12,7 +15,8 @@ script:
- make goveralls

before_deploy:
- pip install --user release-manager==0.1.0
- sudo pip install pyOpenSSL==16.2.0
- pip install --user release-manager==0.4.1

deploy:
skip_cleanup: true
Expand Down
31 changes: 18 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all format lint test goveralls release release-dry clean
.PHONY: all format lint test setup setdown goveralls release release-dry clean

# -----------------------------------------------------------------------------
# CONSTANTS
Expand Down Expand Up @@ -66,15 +66,15 @@ $(merge_log): $(go_gen_files) $(go_src_files) $(go_test_files)
cp $(go_src_files) $(merge_src_dir)
cp $(go_test_files) $(merge_src_dir)

go get -u -t ./$(merge_src_dir)
GO111MODULE=on go get -t ./$(merge_src_dir)

@echo Source merged at: `/bin/date "+%Y-%m-%d---%H-%M-%S"` >> $(merge_log);

$(build_log): $(merge_log)
go get -u github.com/mitchellh/gox/...
GO111MODULE=on go get github.com/mitchellh/gox
gox -osarch=linux/amd64 -output=$(bin_linux) ./$(merge_src_dir)
gox -osarch=darwin/amd64 -output=$(bin_darwin) ./$(merge_src_dir)
go get github.com/konsorten/go-windows-terminal-sequences || true
GO111MODULE=on go get github.com/konsorten/go-windows-terminal-sequences || true
gox -osarch=windows/amd64 -output=$(bin_windows) ./$(merge_src_dir)

@echo Build success at: `/bin/date "+%Y-%m-%d---%H-%M-%S"` >> $(build_log);
Expand All @@ -84,30 +84,35 @@ $(build_log): $(merge_log)
# -----------------------------------------------------------------------------

format:
go fmt ./$(src_dir)
GO111MODULE=on go fmt ./$(src_dir)
gofmt -s -w ./$(src_dir)

lint:
go get -u github.com/golang/lint/golint
GO111MODULE=on go get -u golang.org/x/lint/golint
golint ./$(src_dir)

# -----------------------------------------------------------------------------
# TESTING
# -----------------------------------------------------------------------------

setup:
docker-compose -f ./integration/docker-compose.yml up -d

setdown:
docker-compose -f ./integration/docker-compose.yml down

test: $(merge_log)
mkdir -p $(coverage_dir)
go get -u golang.org/x/tools/cmd/cover/...
go test ./$(merge_src_dir) -tags test -v -covermode=count -coverprofile=$(coverage_out)
GO111MODULE=on go test -parallel=1 ./$(merge_src_dir) -tags test -v -covermode=count -coverprofile=$(coverage_out)

grep -v 'data_generated.go\|schema_generated.go' $(coverage_out) > $(coverage_out)2
mv $(coverage_out)2 $(coverage_out)
sed -i 's/github.com\/snowplow\/dataflow-runner\/build/github.com\/snowplow\/dataflow-runner/g' $(coverage_out)

go tool cover -html=$(coverage_out) -o $(coverage_html)
GO111MODULE=on go tool cover -html=$(coverage_out) -o $(coverage_html)

goveralls: test
go get -u github.com/mattn/goveralls/...
GO111MODULE=on go get -u github.com/mattn/goveralls/...
goveralls -coverprofile=$(coverage_out) -service=travis-ci

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -151,10 +156,10 @@ $(depend_log): $(cluster_avsc) $(playbook_avsc)

wget -N $(codegen_link) -O $(codegen)

go get -u github.com/elodina/go-avro/...
go run $(codegen) --schema $(cluster_avsc) --schema $(playbook_avsc) --out $(generated_schema)
GO111MODULE=on go get -u github.com/elodina/go-avro/...
GO111MODULE=on go run $(codegen) --schema $(cluster_avsc) --schema $(playbook_avsc) --out $(generated_schema)

go get -u github.com/go-bindata/go-bindata/...
GO111MODULE=on go get -u github.com/go-bindata/go-bindata/...
go-bindata -o $(generated_data) $(avro_dir)

@echo Dependencies generated at: `/bin/date "+%Y-%m-%d---%H-%M-%S"` >> $(depend_log);
Expand Down
28 changes: 0 additions & 28 deletions Vagrantfile

This file was deleted.

31 changes: 31 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module github.com/snowplow/dataflow-runner

go 1.13

require (
github.com/armon/go-metrics v0.3.4 // indirect
github.com/aws/aws-sdk-go v1.34.5
github.com/elodina/go-avro v0.0.0-20160406082632-0c8185d9a3ba
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect
github.com/hashicorp/consul/api v1.4.0
github.com/hashicorp/consul/sdk v0.4.0
github.com/hashicorp/errwrap v1.0.0
github.com/hashicorp/go-hclog v0.14.1 // indirect
github.com/hashicorp/go-immutable-radix v1.2.0 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/go-version v1.2.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/serf v0.9.4 // indirect
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/gox v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.6.1
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/sys v0.0.0-20200817085935-3ff754bf58a9 // indirect
golang.org/x/tools v0.0.0-20200817023811-d00afeaade8f // indirect
gopkg.in/urfave/cli.v1 v1.20.0
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
)
Loading

0 comments on commit 6e4804a

Please sign in to comment.