From 7c735cfa47853c88a53753173ccf56e364295f27 Mon Sep 17 00:00:00 2001 From: Alexandre Garand Date: Thu, 4 Jul 2019 14:34:42 +0200 Subject: add travis, go.mod and vendor/ in order to have automatic testing --- .travis.yml | 26 ++++++++++++++++++++++++++ go.mod | 6 ++++++ mailgun/provider.go | 2 +- mailgun/resource_mailgun_domain.go | 2 +- mailgun/resource_mailgun_domain_test.go | 2 +- mailgun/resource_mailgun_route.go | 2 +- mailgun/resource_mailgun_route_test.go | 2 +- scripts/gogetcookie.sh | 11 +++++------ 8 files changed, 42 insertions(+), 11 deletions(-) create mode 100644 .travis.yml create mode 100644 go.mod diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..8054364 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +dist: trusty +sudo: required +services: +- docker +language: go +go: + - "1.12.x" + +install: +# This script is used by the Travis build to install a cookie for +# go.googlesource.com so rate limits are higher when using `go get` to fetch +# packages that live there. +# See: https://github.com/golang/go/issues/12933 +- bash scripts/gogetcookie.sh + +script: +- make test +- make vet +- make website-test + +matrix: + fast_finish: true + allow_failures: + - go: tip +env: + GO111MODULE=on diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..7ef2364 --- /dev/null +++ b/go.mod @@ -0,0 +1,6 @@ +module github.com/fretlink/terraform-provider-mailgun + +require ( + github.com/hashicorp/terraform v0.12.3 + github.com/mailgun/mailgun-go/v3 v3.6.0 +) diff --git a/mailgun/provider.go b/mailgun/provider.go index 2133777..90ea5e5 100644 --- a/mailgun/provider.go +++ b/mailgun/provider.go @@ -3,7 +3,7 @@ package mailgun import ( "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/terraform" - "github.com/mailgun/mailgun-go" + "github.com/mailgun/mailgun-go/v3" ) func Provider() terraform.ResourceProvider { diff --git a/mailgun/resource_mailgun_domain.go b/mailgun/resource_mailgun_domain.go index f859230..1fcba83 100644 --- a/mailgun/resource_mailgun_domain.go +++ b/mailgun/resource_mailgun_domain.go @@ -4,7 +4,7 @@ import ( "context" "fmt" "github.com/hashicorp/terraform/helper/schema" - "github.com/mailgun/mailgun-go" + "github.com/mailgun/mailgun-go/v3" "log" "time" ) diff --git a/mailgun/resource_mailgun_domain_test.go b/mailgun/resource_mailgun_domain_test.go index c35df48..6096c60 100644 --- a/mailgun/resource_mailgun_domain_test.go +++ b/mailgun/resource_mailgun_domain_test.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" - "github.com/mailgun/mailgun-go" + "github.com/mailgun/mailgun-go/v3" "os" "strconv" "testing" diff --git a/mailgun/resource_mailgun_route.go b/mailgun/resource_mailgun_route.go index e19b67f..cf8290f 100644 --- a/mailgun/resource_mailgun_route.go +++ b/mailgun/resource_mailgun_route.go @@ -4,7 +4,7 @@ import ( "context" "fmt" "github.com/hashicorp/terraform/helper/schema" - "github.com/mailgun/mailgun-go" + "github.com/mailgun/mailgun-go/v3" "log" "time" ) diff --git a/mailgun/resource_mailgun_route_test.go b/mailgun/resource_mailgun_route_test.go index b3806c2..2d7b221 100644 --- a/mailgun/resource_mailgun_route_test.go +++ b/mailgun/resource_mailgun_route_test.go @@ -5,7 +5,7 @@ import ( "fmt" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" - "github.com/mailgun/mailgun-go" + "github.com/mailgun/mailgun-go/v3" "strconv" "testing" "time" diff --git a/scripts/gogetcookie.sh b/scripts/gogetcookie.sh index 26c63a6..37955fc 100755 --- a/scripts/gogetcookie.sh +++ b/scripts/gogetcookie.sh @@ -1,10 +1,9 @@ #!/bin/bash -touch ~/.gitcookies -chmod 0600 ~/.gitcookies + touch ~/.gitcookies + chmod 0600 ~/.gitcookies -git config --global http.cookiefile ~/.gitcookies + git config --global http.cookiefile ~/.gitcookies -tr , \\t <<\__END__ >>~/.gitcookies -.googlesource.com,TRUE,/,TRUE,2147483647,o,git-paul.hashicorp.com=1/z7s05EYPudQ9qoe6dMVfmAVwgZopEkZBb1a2mA5QtHE -__END__ + tr , \\t <<\__END__ >>~/.gitcookies +.googlesource.com,TRUE,/,TRUE,2147483647,o,git-alexandre.namebla.gmail.com=1/OtfvUDYg3VAHfIxaqjAuv8MJqu6--gSU_zSkD8YkKPc -- cgit v1.2.3 From 12576b10aba194440c9c2e1c071a18888ffb107c Mon Sep 17 00:00:00 2001 From: Alexandre Garand Date: Thu, 4 Jul 2019 17:39:49 +0200 Subject: cache gopath in travis --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8054364..772e140 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,5 +22,12 @@ matrix: fast_finish: true allow_failures: - go: tip + +cache: + directories: + - $GOPATH/src + - $HOME/.cache/go-build + - $HOME/gopath/pkg/mod + env: GO111MODULE=on -- cgit v1.2.3 From 68936298c66845b16c718cbcfad8ae36ecd5fdfe Mon Sep 17 00:00:00 2001 From: Alexandre Garand Date: Fri, 5 Jul 2019 09:59:40 +0200 Subject: add go 1.11 to travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 772e140..a6b90ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ services: language: go go: - "1.12.x" + - "1.11.x" install: # This script is used by the Travis build to install a cookie for -- cgit v1.2.3