Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.

Commit 14ca4c0

Browse files
authored
Use go modules for dependencies (#43)
* Use go modules for dependencies * PR feedback: put back include in Makefile It is necessary for travis because it uses Makefile targets in build-harness * PR Feedback: Fix .travis.yml Since make targets are based on go modules, travis.yml definition needs to change appropriately to no longer use godep and glide.
1 parent db8ccea commit 14ca4c0

File tree

6 files changed

+422
-36
lines changed

6 files changed

+422
-36
lines changed

.travis.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ sudo: required
22

33
language: go
44
go:
5-
- 1.9.x
5+
- 1.14.x
66

77
addons:
88
apt:
@@ -20,14 +20,10 @@ services:
2020
install:
2121
- make init
2222
- make travis/docker-login
23-
- make go/deps-build
2423
- make go/deps-dev
25-
- make go-get
2624

2725
script:
28-
- make go/deps
29-
- make go/test
30-
- make go/lint
26+
- make lint
3127
- make go/build-all
3228
- ls -l release/
3329
- make docker/build

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.13.11 as builder
1+
FROM golang:1.14.3 as builder
22
RUN mkdir -p /go/src/github.com/cloudposse/prometheus-to-cloudwatch
33
WORKDIR /go/src/github.com/cloudposse/prometheus-to-cloudwatch
44
COPY . .

Makefile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
SHELL = /bin/bash
22

3-
PATH:=$(PATH):$(GOPATH)/bin
4-
53
include $(shell curl --silent -o .build-harness "https://raw.githubusercontent.com/cloudposse/build-harness/master/templates/Makefile.build-harness"; echo .build-harness)
64

5+
.PHONY : go-build
6+
go-build:
7+
CGO_ENABLED=0 go build -v -o "./dist/bin/prometheus-to-cloudwatch" *.go
8+
9+
## Lint code
10+
lint: $(GO) vet
11+
$(call assert-set,GO)
12+
find . ! -path "*/vendor/*" ! -path "*/.glide/*" -type f -name '*.go' | xargs -n 1 golint
713

8-
.PHONY : go-get
9-
go-get:
10-
go get
14+
## Vet code
15+
vet: $(GO)
16+
$(call assert-set,GO)
17+
find . ! -path "*/vendor/*" ! -path "*/.glide/*" -type f -name '*.go' | xargs $(GO) vet -v
1118

1219

13-
.PHONY : go-build
14-
go-build: go-get
15-
CGO_ENABLED=0 go build -v -o "./dist/bin/prometheus-to-cloudwatch" *.go

glide.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

go.mod

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module github.com/cloudposse/prometheus-to-cloudwatch
2+
3+
go 1.14
4+
5+
require (
6+
github.com/aws/aws-sdk-go v1.35.21 // indirect
7+
github.com/gobwas/glob v0.2.3 // indirect
8+
github.com/prometheus/common v0.14.0 // indirect
9+
)

0 commit comments

Comments
 (0)