Skip to content

Commit

Permalink
Merge pull request #32 from Scalr/cleanup-ci
Browse files Browse the repository at this point in the history
Clean up CI and provider help
  • Loading branch information
lbn authored Oct 22, 2020
2 parents 351f6ee + 9d91081 commit 931590d
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 183 deletions.
47 changes: 0 additions & 47 deletions .circleci/config.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

16 changes: 5 additions & 11 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ BUILD_ENV=CGO_ENABLED=0

default: build

build: fmtcheck
build:
$(BUILD_ENV) go build

build-linux: fmtcheck
build-linux:
env $(BUILD_ENV) GOOS=linux GOARCH=amd64 go build

test: fmtcheck
test:
echo $(TEST) | \
$(BUILD_ENV) xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4

testacc: fmtcheck
testacc:
$(BUILD_ENV) TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 15m

vet:
Expand All @@ -30,18 +30,12 @@ vet:
fmt:
gofmt -w $(GOFMT_FILES)

fmtcheck:
@sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'"

errcheck:
@sh -c "'$(CURDIR)/scripts/errcheck.sh'"

test-compile:
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package. For example,"; \
echo " make test-compile TEST=./$(PKG_NAME)"; \
exit 1; \
fi
go test -c $(TEST) $(TESTARGS)
.PHONY: build build-linux test testacc vet fmt fmtcheck errcheck test-compile
.PHONY: build build-linux test testacc vet fmt test-compile

18 changes: 6 additions & 12 deletions scalr/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
providerVersion "github.com/scalr/terraform-provider-scalr/version"
)

const defaultHostname = "my.scalr.com"
const defaultHostname = "scalr.io"

var scalrServiceIDs = []string{"iacp.v3"}

Expand All @@ -50,14 +50,14 @@ func Provider() terraform.ResourceProvider {
"hostname": {
Type: schema.TypeString,
Optional: true,
Description: descriptions["hostname"],
Description: fmt.Sprintf("Scalr instance hostname without scheme. Defaults to %s.", defaultHostname),
DefaultFunc: schema.EnvDefaultFunc("SCALR_HOSTNAME", defaultHostname),
},

"token": {
Type: schema.TypeString,
Optional: true,
Description: descriptions["token"],
Description: "Scalr API token.",
DefaultFunc: schema.EnvDefaultFunc("SCALR_TOKEN", nil),
},
},
Expand Down Expand Up @@ -109,13 +109,13 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) {
services.ForceHostServices(host, hostConfig.Services)
}

// Discover the Terraform Enterprise address.
// Discover the address.
host, err := services.Discover(hostname)
if err != nil {
return nil, err
}

// Get the full Terraform Enterprise service address.
// Get the full service address.
var address *url.URL
var discoErr error
for _, scalrServiceID := range scalrServiceIDs {
Expand Down Expand Up @@ -340,7 +340,7 @@ func checkConstraints(c *disco.Constraints) error {

summary := fmt.Sprintf("Incompatible Scalr provider version v%s", v.String())
details := fmt.Sprintf(
"The configured Terraform Enterprise backend is compatible with Scalr provider\n"+
"The configured Scalr installation is compatible with Scalr provider\n"+
"versions >= %s, <= %s%s.", c.Minimum, c.Maximum, excluding,
)

Expand All @@ -360,9 +360,3 @@ func checkConstraintsWarning(err error) error {
err,
)
}

var descriptions = map[string]string{
"hostname": "The Terraform Enterprise hostname to connect to. Defaults to app.terraform.io.",
"token": "The token used to authenticate with Terraform Enterprise. We recommend omitting\n" +
"the token which can be set as credentials in the CLI config file.",
}
8 changes: 0 additions & 8 deletions scalr/provider_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package scalr

import (
"os"
"strings"
"testing"

Expand Down Expand Up @@ -97,10 +96,3 @@ func testAccPreCheck(t *testing.T) {
t.Fatalf("err: %s", err)
}
}

var GITHUB_TOKEN = os.Getenv("GITHUB_TOKEN")
var GITHUB_POLICY_SET_BRANCH = os.Getenv("GITHUB_POLICY_SET_BRANCH")
var GITHUB_POLICY_SET_PATH = os.Getenv("GITHUB_POLICY_SET_PATH")
var TFE_USER1 = os.Getenv("TFE_USER1")
var TFE_USER2 = os.Getenv("TFE_USER2")
var GITHUB_POLICY_SET_IDENTIFIER = os.Getenv("GITHUB_POLICY_SET_IDENTIFIER")
31 changes: 0 additions & 31 deletions scripts/changelog-links.sh

This file was deleted.

24 changes: 0 additions & 24 deletions scripts/errcheck.sh

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/gofmtcheck.sh

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/gogetcookie.sh

This file was deleted.

0 comments on commit 931590d

Please sign in to comment.