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