diff --git a/dockerfiles/run-pack/Dockerfile b/dockerfiles/run-pack/Dockerfile index 5dc9ff79..4a40a32c 100644 --- a/dockerfiles/run-pack/Dockerfile +++ b/dockerfiles/run-pack/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.5 +FROM alpine ENV GOPATH /.go ENV GOBIN $GOPATH/bin @@ -10,8 +10,7 @@ RUN apk add --no-cache go curl git gcc libc-dev \ && cd $GOPATH/src/app \ && mkdir -p $GOBIN \ && mkdir /barcelona \ - && curl https://glide.sh/get | sh \ - && glide install \ + && go mod download \ && go build -o /barcelona/barcelona-run --ldflags '-linkmode external -extldflags "-static"' \ && rm -rf /.go \ && apk del --purge go curl git gcc libc-dev diff --git a/dockerfiles/run-pack/glide.lock b/dockerfiles/run-pack/glide.lock deleted file mode 100644 index f1834a15..00000000 --- a/dockerfiles/run-pack/glide.lock +++ /dev/null @@ -1,40 +0,0 @@ -hash: b3d2bbd3574b56c9945e47ba6dbf7ac373eba8a7d966c89ea73fd766a8e6988a -updated: 2016-09-06T14:49:21.065826411+09:00 -imports: -- name: github.com/aws/aws-sdk-go - version: 6ac30507cca29249f4d49af45a8efc98b84088ee - subpackages: - - aws - - aws/awserr - - aws/awsutil - - aws/client - - aws/client/metadata - - aws/corehandlers - - aws/credentials - - aws/credentials/ec2rolecreds - - aws/credentials/endpointcreds - - aws/credentials/stscreds - - aws/defaults - - aws/ec2metadata - - aws/request - - aws/session - - aws/signer/v4 - - private/endpoints - - private/protocol - - private/protocol/query - - private/protocol/query/queryutil - - private/protocol/rest - - private/protocol/restxml - - private/protocol/xml/xmlutil - - private/waiter - - service/s3 - - service/sts -- name: github.com/go-ini/ini - version: 6e4869b434bd001f6983749881c7ead3545887d8 -- name: github.com/jmespath/go-jmespath - version: bd40a432e4c76585ef6b72d3fd96fb9b6dc7b68d -- name: github.com/mitchellh/go-ps - version: e2d21980687ce16e58469d98dcee92d27fbbd7fb -- name: github.com/urfave/cli - version: a14d7d367bc02b1f57d88de97926727f2d936387 -testImports: [] diff --git a/dockerfiles/run-pack/glide.yaml b/dockerfiles/run-pack/glide.yaml deleted file mode 100644 index b24b3718..00000000 --- a/dockerfiles/run-pack/glide.yaml +++ /dev/null @@ -1,11 +0,0 @@ -package: . -import: -- package: github.com/aws/aws-sdk-go - version: ^1.4.6 - subpackages: - - aws - - aws/session - - service/s3 -- package: github.com/mitchellh/go-ps -- package: github.com/urfave/cli - version: ^1.18.1 diff --git a/dockerfiles/run-pack/go.mod b/dockerfiles/run-pack/go.mod new file mode 100644 index 00000000..2f293005 --- /dev/null +++ b/dockerfiles/run-pack/go.mod @@ -0,0 +1,14 @@ +module barcelona/run-pack + +go 1.14 + +require ( + github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect + github.com/aws/aws-sdk-go v1.4.6 + github.com/go-ini/ini v1.21.1 + github.com/go-ole/go-ole v1.2.4 // indirect + github.com/honeybadger-io/honeybadger-go v0.5.0 // indirect + github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7 + github.com/mitchellh/go-ps v0.0.0-20160822165447-e2d21980687c + github.com/urfave/cli v1.18.1 +) diff --git a/dockerfiles/run-pack/go.sum b/dockerfiles/run-pack/go.sum new file mode 100644 index 00000000..4f441c64 --- /dev/null +++ b/dockerfiles/run-pack/go.sum @@ -0,0 +1,23 @@ +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= +github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/aws/aws-sdk-go v1.4.6/go.mod h1:ZRmQr0FajVIyZ4ZzBYKG5P3ZqPz9IHG41ZoMu1ADI3k= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-ini/ini v1.21.1/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= +github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= +github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/honeybadger-io/honeybadger-go v0.5.0 h1:aB+rWcUZ1uaOxxbgX2Dazir+vodrMNlWGEp8fd0ttv0= +github.com/honeybadger-io/honeybadger-go v0.5.0/go.mod h1:39ZC81aq3YtRBX7QPVvMj+NsYlsHFKLXNAXwgTo/SCc= +github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/mitchellh/go-ps v0.0.0-20160822165447-e2d21980687c/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= +github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/shirou/gopsutil v2.18.12+incompatible h1:1eaJvGomDnH74/5cF4CTmTbLHAriGFsTZppLXDX93OM= +github.com/shirou/gopsutil v2.18.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/urfave/cli v1.18.1/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/dockerfiles/run-pack/load_env_and_run.go b/dockerfiles/run-pack/load_env_and_run.go index 3b38a859..36c642b4 100644 --- a/dockerfiles/run-pack/load_env_and_run.go +++ b/dockerfiles/run-pack/load_env_and_run.go @@ -20,6 +20,7 @@ func getValues(c S3Client, m map[string]string) (map[string]string, error) { func loadEnvAndRun(region string, bucket string, envs map[string]string, command []string) { cli, err := NewS3Client(region, bucket) + if err != nil { panic(err) } diff --git a/dockerfiles/run-pack/main.go b/dockerfiles/run-pack/main.go index 596cacf3..0d9d81ad 100644 --- a/dockerfiles/run-pack/main.go +++ b/dockerfiles/run-pack/main.go @@ -5,9 +5,11 @@ import ( "strings" "github.com/urfave/cli" + "github.com/honeybadger-io/honeybadger-go" ) func main() { + defer honeybadger.Monitor() app := cli.NewApp() app.Name = "barcelona-run" app.Version = "0.0.1" diff --git a/dockerfiles/run-pack/s3_client.go b/dockerfiles/run-pack/s3_client.go index 34a281c2..edd1b94d 100644 --- a/dockerfiles/run-pack/s3_client.go +++ b/dockerfiles/run-pack/s3_client.go @@ -42,7 +42,10 @@ func newSession(region string) (*session.Session, error) { return nil, err } - sess, err := session.NewSession(&aws.Config{Region: ®ion}) + sess, err := session.NewSession(&aws.Config{ + CredentialsChainVerboseErrors: aws.Bool(true), + Region: ®ion, + }) if err != nil { return nil, err } @@ -55,7 +58,10 @@ func newSession(region string) (*session.Session, error) { } return sess, err } else { - sess, err := session.NewSession(&aws.Config{Region: ®ion}) + sess, err := session.NewSession(&aws.Config{ + CredentialsChainVerboseErrors: aws.Bool(true), + Region: ®ion, + }) if err != nil { return nil, err }