From f0c86f771a039ae3cdb1b0e37c46a99d2cc1c79a Mon Sep 17 00:00:00 2001 From: Liam Galvin Date: Thu, 9 Jan 2020 11:13:55 +0000 Subject: [PATCH] Fix build --- .travis.yml | 28 ++++++++++++++++++++++++---- Makefile | 13 +++++-------- goreleaser.yml | 27 --------------------------- scripts/package.sh | 15 +++++++++++++++ 4 files changed, 44 insertions(+), 39 deletions(-) delete mode 100644 goreleaser.yml create mode 100755 scripts/package.sh diff --git a/.travis.yml b/.travis.yml index 375c87b..6f6a84d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,27 @@ env: - secure: aHaMh/YPzghJeQKyki/Nkbn0194xW6L9yynHdyyESTOAPuF+IYBBQhFPXI1q8r/ovhhiiQPbqfYAuWez04NC05WygSB/RJTwf+n2e2sv3PV2aDkHWZvSyiwbPLoPLE7T5SVQWnzom19qKbzHr+B0dP126GkW5jhxIXVQvFm0xs3nnyOmZwnp5C2gWukPf8rhWnvel7BpauyUvweHhuQJr78C56HGyMttddM1vjNGKoXpumokfAjIcX0h5zikwTACBana64QoK0qEoaJtI4og9L90O6+zo+DIjaTmLQj3dy9vql0nuzBvzGIX9UEexUC0GqQZa1dQNXei/N7XtThCSa3RCQkRFLeGncB/MZQ9u2JAeMUnkdYXohnkNpihqohKlZ1j2IoeoNfwsGIMrOJCXcnH5ZIjuVFc5uXhT6kR25zrcxxkau+9csq37L6YZxM4JwoMvF+yIFmmEZancAnU6tSrw4B+IrsiWEWMWirq2WALrmKZIlyeJi/vPd2qIP+rwaTazC5Kdz6BHkC5Nmb84rbPJw+0GqORHBkO3O3eQmfXxnrVyxwHfq+a4qKTj3JSGAZaKT9a1Cru5clO4CZOIOy9m8439/s/NgGeHtIZjFTL4rDhBRhWzzyrAxVfpk2R48JcF39gwoKF92RSLKY2xyRchjyN5v5/OOOwO88ri18= - secure: J7j5mhXkCrQBWXiekH/fqavq+64kPs4fKSVYR/UydJ+jYcdV/J4EeUQdZNA723JCYf6nSaeTOH4rQL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EABsB9K/z94lspoBPUy4HnAWrLqHWAYUBnhuZXfy7VO2v9aIjSM74o8DdutPfErD2mQe9JZTeU80P/9rsaFtE7Romv9LEXJzBg2jucvAv4FmLVqTRwXucSz/1euKYAyGJkJElCGOCYwp8mQpDOPDqpTpUk6yZOni0W0CkgWau+fD/bRnkjjRyRDj2anQitMUM/J0= -script: -- make -after_success: -- make release + - secure: OihOsFf4xe0CenuanxpurE11A+JeAv5Rdz8bLU0BznUt85v4PJEzqWBxRdHTs76IydA3vNa96WMEUvWMCsyknsmB9pQ6aD1Iofun25B2luI7mbQA1RUgy1rTT0QCbrlo2HlURRBTuVvwc6p2rb0+Wg+ODfLaESuvwBaPoT8dfyo9PmZCAS5nOlWJHImH0LESH8zpIiwLzhvNVP4fPDZep/ZjBxJzp3lhRWy/ls8+b6OiDEoQkhOOEjLQJeojmHga4EB0T2iMB2LTzPgRMbFT/t64z62QRfIAsfH3CwlHpgwJqdhnepo/7Ptn6QR4ZnnCLxLXTMRLPsylWQuUT1+2WW5rfJiRNk1G/bUohHbpXXZ4E3o5B0tFLYpbuzJRoDhJy/K98BT1voDrV4RgRDEPizmF6NJiYOm12pCXKb7nfMCgS1I9LVKbH+22ZdIMJ3AWFT6nHxy52I5x6A2w93Tct59gINI4HI8uOnEeNQOaKQMgpovXRHj/iZqjnalHVcz4k7ntWDwNqw1MkI8JMwtpx/dNcAGLVN/qIpSjknAyPBCWD4M54E2PdyXR5FNB5A/56hUic4iraNuPvXo8DVRoJ3US8FIW+4nkOsH4gg6RQwamzuV84Cvt6IaNAKnW8gruWjoR2GPOlw6OXJrjqgl4cY/sCyzu3EgwaESGymvIDlU= +jobs: + include: + - stage: test + name: Run tests + script: + - make test + - stage: package + name: Package + script: + - make package + deploy: + provider: releases + skip_cleanup: true + name: "$TRAVIS_TAG" + file: + - terraform-provider-alienvault_${TRAVIS_TAG}_linux_amd64.zip + - terraform-provider-alienvault_${TRAVIS_TAG}_darwin_amd64.zip + - terraform-provider-alienvault_${TRAVIS_TAG}_windows_amd64.zip + api_key: + secure: QRSprDZq1BScT5H4ZjRTadp0A4oEu0HrXhzSBcn1VVEvHzrWk1+RjGNPxn3IcgPA5ZQ3CdQyum19QLagLNy0SoVFnp+HdpLaOk/Tj7NhzQyNXDju1bD2LGhS5M3Ldm8K62+NGVP1EPhLbSi3nP38n4ZdhDUBVqosaf4Z7rlwnra4E2JFwjpkFosvBTEEQjNIuUr6fJfou8F68W9+hXYr+pTxpgAsymVuJfpdvdoJlO7becSw502UnVJ9pTMrx/SH2/4AyBnHXdDA28r16hkwfaVKZ3UoyyivF9TdKLCUHO2xnWoG5cFXhNvZo04/4OoXYLWw2FkWe/WdSxCOInU2PK0WY6X7v5so9r/WV+LcOYdbn7R7j+UWT7USusHfIBrIBDuaoBFaNXrrYibw2MCgMzD7i3HZ0ET7VZNqoYV43uZiNjPX3lWwtX7feW8TtRHRPM8m4S+ceyBMOCPUuPbKI7UTskPPI4xrD2zBlSnJVzeCMApv3bSo7v96+IV+Kr6GQx2q1VWtaFyH+6nalnwo0kS6IwIPopxGIAstvxiTDKPcgGc7SmRmYdUe9yusICxXdE8uZZzlkf5Btl6SnF468OzbrET6VgJg8O53LcmppVsxdvaxlGOn8Iv6NFXO5KHgJH2DARYzJoDA6HKBlKJf5A7W2xPmqTdV48agxkyaSYQ= + on: + repo: form3tech-oss/terraform-provider-alienvault + tags: true diff --git a/Makefile b/Makefile index 05d846e..be12ac3 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,14 @@ -default : vet test build +default: test -.PHONY: build -build: - go build +.PHONY: package +package: + ./scripts/package.sh .PHONY: vet vet: go vet ./... -.PHONY: test +.PHONY: vet test: go test -v ./... -.PHONY: release -release: - @curl -sL http://git.io/goreleaser | bash diff --git a/goreleaser.yml b/goreleaser.yml deleted file mode 100644 index 5af34f4..0000000 --- a/goreleaser.yml +++ /dev/null @@ -1,27 +0,0 @@ -# .goreleaser.yml -archives: - - - # Builds reference which build instances should be archived in this archive. - builds: - - - goos: - - darwin - - linux - - windows - goarch: - - amd64 - - # Archive name template. - # Defaults: - # - if format is `tar.gz`, `gz` or `zip`: - # - `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}` - # - if format is `binary`: - # - `{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}` - name_template: "terraform-provider-alienvault_v{{.Version}}" - - # Archive format. Valid options are `tar.gz`, `gz`, `zip` and `binary`. - # If format is `binary`, no archives are created and the binaries are instead - # uploaded directly. - # Default is `tar.gz`. - format: zip - diff --git a/scripts/package.sh b/scripts/package.sh new file mode 100755 index 0000000..393d5d5 --- /dev/null +++ b/scripts/package.sh @@ -0,0 +1,15 @@ +#!/bin/bash +BINARY="terraform-provider-alienvault_${TRAVIS_TAG}" +GO111MODULE=on + +GOOS=darwin GOARCH=amd64 go build -o "${BINARY}" +zip "${BINARY}_darwin_amd64.zip" "${BINARY}" +rm -f "${BINARY}" + +GOOS=linux GOARCH=amd64 go build -o "${BINARY}" +zip "${BINARY}_linux_amd64.zip" "${BINARY}" +rm -f "${BINARY}" + +GOOS=windows GOARCH=amd64 go build -o "${BINARY}" +zip "${BINARY}_windows_amd64.zip" "${BINARY}" +rm -f "${BINARY}"