From 4727b2149ac1f2e1a23b3353e0aaf43ccff490b0 Mon Sep 17 00:00:00 2001 From: Yoriyasu Yano <430092+yorinasub17@users.noreply.github.com> Date: Fri, 31 Jul 2020 19:32:44 -0500 Subject: [PATCH] Switch to using go modules for dependency management --- .circleci/config.yml | 50 +++++------------------------------- Gopkg.lock | 61 -------------------------------------------- Gopkg.toml | 32 ----------------------- go.mod | 10 ++++++++ go.sum | 17 ++++++++++++ 5 files changed, 33 insertions(+), 137 deletions(-) delete mode 100644 Gopkg.lock delete mode 100644 Gopkg.toml create mode 100644 go.mod create mode 100644 go.sum diff --git a/.circleci/config.yml b/.circleci/config.yml index e9e5ea6..55477cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,51 +1,22 @@ -workspace_root: &workspace_root - /go/src/github.com/gruntwork-io/fetch - -vendor_path: &vendor_path - /go/src/github.com/gruntwork-io/fetch/vendor - defaults: &defaults - working_directory: *workspace_root docker: - - image: 087285199408.dkr.ecr.us-east-1.amazonaws.com/circle-ci-test-image-base:latest + - image: 087285199408.dkr.ecr.us-east-1.amazonaws.com/circle-ci-test-image-base:go1.13 version: 2 jobs: - install_dependencies: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: *workspace_root - - restore_cache: - keys: - - dep-{{ checksum "Gopkg.lock" }} - - run: dep ensure - - save_cache: - key: dep-{{ checksum "Gopkg.lock" }} - paths: - - *vendor_path - - persist_to_workspace: - root: *workspace_root - paths: vendor - test: <<: *defaults steps: - checkout - - attach_workspace: - at: *workspace_root - - run: run-go-tests --circle-ci-2 + - run: run-go-tests build: <<: *defaults steps: - checkout - - attach_workspace: - at: *workspace_root - - run: CGO_ENABLED=0 build-go-binaries --circle-ci-2 --app-name fetch --dest-path bin --ld-flags "-X main.VERSION=$CIRCLE_TAG" + - run: CGO_ENABLED=0 build-go-binaries --app-name fetch --dest-path bin --ld-flags "-X main.VERSION=$CIRCLE_TAG" - persist_to_workspace: - root: *workspace_root + root: . paths: bin deploy: @@ -53,7 +24,7 @@ jobs: steps: - checkout - attach_workspace: - at: *workspace_root + at: . - run: cd bin && sha256sum * > SHA256SUMS - run: upload-github-release-assets bin/* @@ -61,13 +32,7 @@ workflows: version: 2 build-and-test: jobs: - - install_dependencies: - filters: - tags: - only: /^v.*/ - test: - requires: - - install_dependencies filters: tags: only: /^v.*/ @@ -96,7 +61,4 @@ workflows: branches: only: master jobs: - - install_dependencies - - test: - requires: - - install_dependencies \ No newline at end of file + - test diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 11cdd71..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,61 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:0deddd908b6b4b768cfc272c16ee61e7088a60f7fe2f06c547bd3d8e1f8b8e77" - name = "github.com/davecgh/go-spew" - packages = ["spew"] - pruneopts = "" - revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" - version = "v1.1.1" - -[[projects]] - digest = "1:f1a75a8e00244e5ea77ff274baa9559eb877437b240ee7b278f3fc560d9f08bf" - name = "github.com/dustin/go-humanize" - packages = ["."] - pruneopts = "" - revision = "9f541cc9db5d55bce703bd99987c9d5cb8eea45e" - version = "v1.0.0" - -[[projects]] - digest = "1:7398a6dcdc9283fdbd3ee279c7b80fa81e7ad9d6f9e71bc8e6394810870cc54d" - name = "github.com/hashicorp/go-version" - packages = ["."] - pruneopts = "" - revision = "2e7f5ea8e27bb3fdf9baa0881d16757ac4637332" - -[[projects]] - digest = "1:256484dbbcd271f9ecebc6795b2df8cad4c458dd0f5fd82a8c2fa0c29f233411" - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - pruneopts = "" - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - digest = "1:381bcbeb112a51493d9d998bbba207a529c73dbb49b3fd789e48c63fac1f192c" - name = "github.com/stretchr/testify" - packages = ["assert"] - pruneopts = "" - revision = "ffdc059bfe9ce6a4e144ba849dbedead332c6053" - version = "v1.3.0" - -[[projects]] - digest = "1:e85837cb04b78f61688c6eba93ea9d14f60d611e2aaf8319999b1a60d2dafbfa" - name = "gopkg.in/urfave/cli.v1" - packages = ["."] - pruneopts = "" - revision = "cfb38830724cc34fedffe9a2a29fb54fa9169cd1" - version = "v1.20.0" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/dustin/go-humanize", - "github.com/hashicorp/go-version", - "github.com/stretchr/testify/assert", - "gopkg.in/urfave/cli.v1", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 79fd464..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,32 +0,0 @@ - -# Gopkg.toml example -# -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" - - -[[constraint]] - name = "github.com/codegangsta/cli" - -[[constraint]] - name = "github.com/hashicorp/go-version" - -[[constraint]] - name = "github.com/dustin/go-humanize" - version = "1.0.0" diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..805a81a --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/gruntwork-io/fetch + +go 1.14 + +require ( + github.com/dustin/go-humanize v1.0.0 + github.com/hashicorp/go-version v1.2.1 + github.com/stretchr/testify v1.6.1 + gopkg.in/urfave/cli.v1 v1.20.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..50d54c4 --- /dev/null +++ b/go.sum @@ -0,0 +1,17 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= +gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=