Skip to content

Commit

Permalink
set up project
Browse files Browse the repository at this point in the history
  • Loading branch information
gavincabbage committed Mar 21, 2019
1 parent 8064c4c commit 092b654
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ARG GO_VERSION=1.12

FROM golang:${GO_VERSION}-alpine

RUN apk update
RUN apk add --no-cache \
build-base \
make \
git

WORKDIR /chiv
COPY . .

RUN make setup
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
GOTOOLS = \
github.com/golangci/golangci-lint/cmd/golangci-lint \
golang.org/x/tools/cmd/cover \

.PHONY: setup
setup:
go get $(GOTOOLS)
go mod download

.PHONY: install
install:
@echo not yet implemented

.PHONY: test
test:
echo 'mode: atomic' > cover.out && go test -p 1 -tags test -coverprofile cover.out -covermode=atomic -timeout=30s ./...

.PHONY: cover
cover: test
go tool cover -html=cover.out

.PHONY: lint
lint:
golangci-lint run

.PHONY: clean
clean:
rm cover.out
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# chiv

Archive arbitrarily large database tables to Amazon S3 using cursors and multipart upload
10 changes: 10 additions & 0 deletions chiv.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package chiv

import (
"github.com/aws/aws-sdk-go/service/s3/s3manager"
)

func Archive(uploader *s3manager.Uploader) {

//https://docs.aws.amazon.com/code-samples/latest/catalog/go-s3-upload_arbitrary_sized_stream.go.html
}
12 changes: 12 additions & 0 deletions chiv_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package chiv_test

import (
"testing"

"github.com/gavincabbage/chiv"
)

func TestArchive(t *testing.T) {
chiv.Archive()
t.Log("test test test")
}
22 changes: 22 additions & 0 deletions codeship-services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
test:
build: .
cached: true
depends_on:
- postgres
- s3

lint:
build: .
cached: true

postgres:
image: postgres:11.2
environment:
- POSTGRES_DB=test
cached: true

s3:
image: localstack/localstack:0.9.0
environment:
- SERVICES=s3
cached: true
8 changes: 8 additions & 0 deletions codeship-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- type: parallel
steps:
- name: test
service: test
command: make test
- name: lint
service: lint
command: make lint
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/gavincabbage/chiv

go 1.12

require (
github.com/aws/aws-sdk-go v1.18.6
github.com/stretchr/testify v1.3.0 // indirect
golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53 // indirect
)
17 changes: 17 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
github.com/aws/aws-sdk-go v1.18.6 h1:NuUz/+bi6C5v3BpIXW/VfovfMpvlhl1WUnD0EiDkOwQ=
github.com/aws/aws-sdk-go v1.18.6/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
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/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
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.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53 h1:kcXqo9vE6fsZY5X5Rd7R1l7fTgnWaDCVmln65REefiE=
golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

0 comments on commit 092b654

Please sign in to comment.