From a9b72ec6bb12c0d3949a4712ca93270ecaeeba59 Mon Sep 17 00:00:00 2001 From: Derek Bassett Date: Wed, 2 Sep 2020 12:24:55 -0600 Subject: [PATCH 1/4] Use releaser plug in to generate binaries for both linux and mac os. --- .buildkite/pipeline.yml | 20 ++--- Gopkg.lock | 175 ---------------------------------------- Gopkg.toml | 23 ------ 3 files changed, 10 insertions(+), 208 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b0beaf9..68f5f2b 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -88,13 +88,13 @@ steps: # Post-Publish ############################## - # This script will use the previously written version_wf file to update - # the version inside of github, as well as create release notes with a - # link back to the merged pull request. - #- label: 'postbuild_tagrepo_update_releasenotes' - # env: - # # Use automatic versioning. - # AUTOTAGREPO: true - # # Collapse the new release with the previous release. - # WF_COLLAPSERELEASE: true - # command: 'workflow postbuild_tagrepo_update_releasenotes' + - label: ':beer: tap' + branches: master + commands: | + #!/bin/bash -e + git clean -ffxdq + docker run -t --rm --privileged \ + -v $$PWD:/src/github.com/sendgrid/aws-env \ + -w /src/github.com/sendgrid/aws-env \ + -e GITHUB_TOKEN=$$WF_GITHUB_TOKEN \ + goreleaser/goreleaser release diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 016f2d4..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,175 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:5510829119ed54ad9477e376edc79e7097f3ffcf6a72837af49e25473e1d3861" - name = "github.com/aws/aws-sdk-go" - packages = [ - "aws", - "aws/awserr", - "aws/awsutil", - "aws/client", - "aws/client/metadata", - "aws/corehandlers", - "aws/credentials", - "aws/credentials/ec2rolecreds", - "aws/credentials/endpointcreds", - "aws/credentials/stscreds", - "aws/csm", - "aws/defaults", - "aws/ec2metadata", - "aws/endpoints", - "aws/request", - "aws/session", - "aws/signer/v4", - "internal/sdkio", - "internal/sdkrand", - "internal/sdkuri", - "internal/shareddefaults", - "private/protocol", - "private/protocol/json/jsonutil", - "private/protocol/jsonrpc", - "private/protocol/query", - "private/protocol/query/queryutil", - "private/protocol/rest", - "private/protocol/xml/xmlutil", - "service/ssm", - "service/sts", - ] - pruneopts = "UT" - revision = "8cf662a972fa7fba8f2c1ec57648cf840e2bb401" - version = "v1.14.30" - -[[projects]] - digest = "1:731d215a2b7038d6afd3908488814fc481c662038de293d248a0f637a9b68ade" - name = "github.com/aws/aws-sdk-go-v2" - packages = [ - "aws", - "aws/awserr", - "aws/signer/v4", - "internal/awsutil", - "internal/sdk", - "private/protocol", - "private/protocol/json/jsonutil", - "private/protocol/jsonrpc", - "private/protocol/rest", - "service/ssm", - ] - pruneopts = "UT" - revision = "0143dbcf72cf30047f4830d714f7511e74d44034" - version = "v0.6.0" - -[[projects]] - digest = "1:a2c1d0e43bd3baaa071d1b9ed72c27d78169b2b269f71c105ac4ba34b1be4a39" - name = "github.com/davecgh/go-spew" - packages = ["spew"] - pruneopts = "UT" - revision = "346938d642f2ec3594ed81d874461961cd0faa76" - version = "v1.1.0" - -[[projects]] - digest = "1:fe8a03a8222d5b913f256972933d26d24ad7c8286692a42943bc01633cc8fce3" - name = "github.com/go-ini/ini" - packages = ["."] - pruneopts = "UT" - revision = "358ee7663966325963d4e8b2e1fbd570c5195153" - version = "v1.38.1" - -[[projects]] - digest = "1:e22af8c7518e1eab6f2eab2b7d7558927f816262586cd6ed9f349c97a6c285c4" - name = "github.com/jmespath/go-jmespath" - packages = ["."] - pruneopts = "UT" - revision = "0b12d6b5" - -[[projects]] - digest = "1:40e195917a951a8bf867cd05de2a46aaf1806c50cf92eebf4c16f78cd196f747" - name = "github.com/pkg/errors" - packages = ["."] - pruneopts = "UT" - revision = "645ef00459ed84a119197bfb8d8205042c6df63d" - version = "v0.8.0" - -[[projects]] - digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - pruneopts = "UT" - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - digest = "1:9e9193aa51197513b3abcb108970d831fbcf40ef96aa845c4f03276e1fa316d2" - name = "github.com/sirupsen/logrus" - packages = ["."] - pruneopts = "UT" - revision = "c155da19408a8799da419ed3eeb0cb5db0ad5dbc" - version = "v1.0.5" - -[[projects]] - digest = "1:c40d65817cdd41fac9aa7af8bed56927bb2d6d47e4fea566a74880f5c2b1c41e" - name = "github.com/stretchr/testify" - packages = [ - "assert", - "require", - ] - pruneopts = "UT" - revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" - version = "v1.2.2" - -[[projects]] - digest = "1:b24d38b282bacf9791408a080f606370efa3d364e4b5fd9ba0f7b87786d3b679" - name = "github.com/urfave/cli" - packages = ["."] - pruneopts = "UT" - revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1" - version = "v1.20.0" - -[[projects]] - branch = "master" - digest = "1:3f3a05ae0b95893d90b9b3b5afdb79a9b3d96e4e36e099d841ae602e4aca0da8" - name = "golang.org/x/crypto" - packages = ["ssh/terminal"] - pruneopts = "UT" - revision = "a2144134853fc9a27a7b1e3eb4f19f1a76df13c9" - -[[projects]] - branch = "master" - digest = "1:b521f10a2d8fa85c04a8ef4e62f2d1e14d303599a55d64dabf9f5a02f84d35eb" - name = "golang.org/x/sync" - packages = ["errgroup"] - pruneopts = "UT" - revision = "37e7f081c4d4c64e13b10787722085407fe5d15f" - -[[projects]] - branch = "master" - digest = "1:3364d01296ce7eeca363e3d530ae63a2092d6f8efb85fb3d101e8f6d7de83452" - name = "golang.org/x/sys" - packages = [ - "unix", - "windows", - ] - pruneopts = "UT" - revision = "ac767d655b305d4e9612f5f6e33120b9176c4ad4" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/aws/aws-sdk-go-v2/service/ssm", - "github.com/aws/aws-sdk-go/aws", - "github.com/aws/aws-sdk-go/aws/credentials", - "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds", - "github.com/aws/aws-sdk-go/aws/ec2metadata", - "github.com/aws/aws-sdk-go/aws/session", - "github.com/aws/aws-sdk-go/service/ssm", - "github.com/aws/aws-sdk-go/service/sts", - "github.com/pkg/errors", - "github.com/sirupsen/logrus", - "github.com/stretchr/testify/assert", - "github.com/stretchr/testify/require", - "github.com/urfave/cli", - "golang.org/x/sync/errgroup", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 17d99a5..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,23 +0,0 @@ -[[constraint]] - name = "github.com/aws/aws-sdk-go" - version = "1.14.30" - -[[constraint]] - name = "github.com/pkg/errors" - version = "0.8.0" - -[[constraint]] - name = "github.com/sirupsen/logrus" - version = "1.0.5" - -[[constraint]] - name = "github.com/stretchr/testify" - version = "1.2.2" - -[[constraint]] - name = "github.com/urfave/cli" - version = "1.20.0" - -[prune] - go-tests = true - unused-packages = true From 9364d46a0fecd1bab9929814ba9540b808eed4f6 Mon Sep 17 00:00:00 2001 From: Derek Bassett Date: Wed, 2 Sep 2020 12:41:45 -0600 Subject: [PATCH 2/4] Configuring goreleaser --- .gitignore | 1 + .goreleaser.yml | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .goreleaser.yml diff --git a/.gitignore b/.gitignore index 3296f75..44dc6f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +dist/ /aws-env /coverage.* version_wf diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..c239cea --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,78 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +before: + hooks: + # You may remove this if you don't use go modules. + - go mod download + # you may remove this if you don't need go generate + - go generate ./... +builds: + - main: ./cmd/aws-env + binary: aws-env + env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin +archives: + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' +#brew: +# name: aws-env +# +# github: +# owner: sendgrid +# name: homebrew-tap +# +# # Allows you to set a custom download strategy. +# # Default is empty. +# download_strategy: GitHubPrivateRepositoryReleaseDownloadStrategy +# +# # Allows you to add a custom require_relative at the top of the formula template +# # Default is empty +# custom_require: "../lib/custom_download_strategy" +# +# # Git author used to commit to the repository. +# # Defaults are shown. +# commit_author: +# name: goreleaserbot +# email: team-autobots@sendgrid.com +# +# # Folder inside the repository to put the formula. +# # Default is the root folder. +# folder: Formula +# +# # Caveats for the user of your binary. +# # Default is empty. +# caveats: "Must be run through aws-okta" +# +# # Your app's homepage. +# # Default is empty. +# homepage: "https://github.com/sendgrid/aws-env" +# +# # Your app's description. +# # Default is empty. +# description: "A small utility to help populate environment variables using secrets stored in AWS Parameter Store" +# +# # Setting this will prevent goreleaser to actually try to commit the updated +# # formula - instead, the formula file will be stored on the dist folder only, +# # leaving the responsibility of publishing it to the user. +# # If set to auto, the release will not be uploaded to the homebrew tap +# # in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1 +# # Default is false. +# skip_upload: false \ No newline at end of file From 8c83982e09c9baf1664f0a28d40737339ff381e4 Mon Sep 17 00:00:00 2001 From: Derek Bassett Date: Wed, 2 Sep 2020 12:48:28 -0600 Subject: [PATCH 3/4] Update brews release --- .goreleaser.yml | 91 +++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 44 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index c239cea..200d406 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -15,6 +15,53 @@ builds: - linux - windows - darwin + +brews: + - + name: aws-env + + tap: + owner: sendgrid + name: homebrew-tap + + # Allows you to set a custom download strategy. + # Default is empty. + download_strategy: GitHubPrivateRepositoryReleaseDownloadStrategy + + # Allows you to add a custom require_relative at the top of the formula template + # Default is empty + custom_require: "../lib/custom_download_strategy" + + # Git author used to commit to the repository. + # Defaults are shown. + commit_author: + name: goreleaserbot + email: team-autobots@sendgrid.com + + # Folder inside the repository to put the formula. + # Default is the root folder. + folder: Formula + + # Caveats for the user of your binary. + # Default is empty. + caveats: "Must be run through aws-okta" + + # Your app's homepage. + # Default is empty. + homepage: "https://github.com/sendgrid/aws-env" + + # Your app's description. + # Default is empty. + description: "A small utility to help populate environment variables using secrets stored in AWS Parameter Store" + + # Setting this will prevent goreleaser to actually try to commit the updated + # formula - instead, the formula file will be stored on the dist folder only, + # leaving the responsibility of publishing it to the user. + # If set to auto, the release will not be uploaded to the homebrew tap + # in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1 + # Default is false. + skip_upload: false + archives: - replacements: darwin: Darwin @@ -32,47 +79,3 @@ changelog: exclude: - '^docs:' - '^test:' -#brew: -# name: aws-env -# -# github: -# owner: sendgrid -# name: homebrew-tap -# -# # Allows you to set a custom download strategy. -# # Default is empty. -# download_strategy: GitHubPrivateRepositoryReleaseDownloadStrategy -# -# # Allows you to add a custom require_relative at the top of the formula template -# # Default is empty -# custom_require: "../lib/custom_download_strategy" -# -# # Git author used to commit to the repository. -# # Defaults are shown. -# commit_author: -# name: goreleaserbot -# email: team-autobots@sendgrid.com -# -# # Folder inside the repository to put the formula. -# # Default is the root folder. -# folder: Formula -# -# # Caveats for the user of your binary. -# # Default is empty. -# caveats: "Must be run through aws-okta" -# -# # Your app's homepage. -# # Default is empty. -# homepage: "https://github.com/sendgrid/aws-env" -# -# # Your app's description. -# # Default is empty. -# description: "A small utility to help populate environment variables using secrets stored in AWS Parameter Store" -# -# # Setting this will prevent goreleaser to actually try to commit the updated -# # formula - instead, the formula file will be stored on the dist folder only, -# # leaving the responsibility of publishing it to the user. -# # If set to auto, the release will not be uploaded to the homebrew tap -# # in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1 -# # Default is false. -# skip_upload: false \ No newline at end of file From 9b0c0f80fb768b5a582c990f09a6ec25f7e58bed Mon Sep 17 00:00:00 2001 From: Derek Bassett Date: Wed, 2 Sep 2020 12:50:30 -0600 Subject: [PATCH 4/4] Lock down releaser version. --- .buildkite/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 68f5f2b..a5c8f19 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -97,4 +97,4 @@ steps: -v $$PWD:/src/github.com/sendgrid/aws-env \ -w /src/github.com/sendgrid/aws-env \ -e GITHUB_TOKEN=$$WF_GITHUB_TOKEN \ - goreleaser/goreleaser release + goreleaser/goreleaser:v0.142.0 release