Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

Commit

Permalink
Merge pull request #18 from Financial-Times/UPPSF-143-improvements
Browse files Browse the repository at this point in the history
Uppsf 143 improvements
  • Loading branch information
gotha committed Feb 19, 2019
2 parents 822bde9 + 6c41a3f commit c8ec645
Show file tree
Hide file tree
Showing 12 changed files with 290 additions and 212 deletions.
34 changes: 17 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
version: 2
jobs:
build:
working_directory: /go/src/github.com/Financial-Times/content-collection-unfolder
docker:
- image: golang:1.8.3
environment:
GOPATH: /go
CIRCLE_TEST_REPORTS: /tmp/test-results
CIRCLE_COVERAGE_REPORT: /tmp/coverage-results
- image: golang:1.11
working_directory: /go/src/github.com/Financial-Times/content-collection-unfolder
environment:
GOPATH: /go
CIRCLE_TEST_REPORTS: /tmp/test-results
CIRCLE_COVERAGE_REPORT: /tmp/coverage-results

steps:
- checkout
- run:
name: External Dependencies
command: |
go get -u github.com/mattn/goveralls
go get -u github.com/jstemmer/go-junit-report
go get -u github.com/kardianos/govendor
go get -u github.com/haya14busa/goverage
go get -u github.com/golang/dep/cmd/dep
- run:
name: Test Results
name: Create Test Folders
command: |
mkdir -p ${CIRCLE_TEST_REPORTS}
mkdir -p ${CIRCLE_COVERAGE_REPORT}
mkdir -p $CIRCLE_TEST_REPORTS
mkdir -p $CIRCLE_COVERAGE_REPORT
- run:
name: Govendor Sync
command: govendor sync -v
name: Download Vendored Dependencies
command: dep ensure -v -vendor-only
- run:
name: Go Build
command: go build -v
command: go build
- run:
name: Run Tests
command: |
govendor test -race -v +local | /go/bin/go-junit-report > ${CIRCLE_TEST_REPORTS}/main.xml
goverage -covermode=atomic -race -coverprofile=${CIRCLE_COVERAGE_REPORT}/coverage.out ./...
command: go test -race -cover -coverprofile=${CIRCLE_COVERAGE_REPORTS}/coverage.out ./... | go-junit-report > ${CIRCLE_TEST_REPORTS}/junit.xml
- run:
name: Upload Coverage
command: /go/bin/goveralls -coverprofile=${CIRCLE_COVERAGE_REPORT}/coverage.out -service=circle-ci -repotoken=$COVERALLS_TOKEN
command: goveralls -coverprofile=${CIRCLE_COVERAGE_REPORTS}/coverage.out -service=circle-ci -repotoken=${COVERALLS_TOKEN}
- store_test_results:
path: /tmp/test-results

dockerfile:
working_directory: /content-collection-unfolder
docker:
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM golang:1.8-alpine
FROM golang:1.11-alpine

ENV PROJECT=content-collection-unfolder
COPY . /${PROJECT}-sources/

RUN apk --no-cache --virtual .build-dependencies add git \
RUN apk --no-cache --virtual .build-dependencies add git curl \
&& ORG_PATH="github.com/Financial-Times" \
&& REPO_PATH="${ORG_PATH}/${PROJECT}" \
&& mkdir -p $GOPATH/src/${ORG_PATH} \
Expand All @@ -19,8 +19,8 @@ RUN apk --no-cache --virtual .build-dependencies add git \
&& LDFLAGS="-X '"${BUILDINFO_PACKAGE}$VERSION"' -X '"${BUILDINFO_PACKAGE}$DATETIME"' -X '"${BUILDINFO_PACKAGE}$REPOSITORY"' -X '"${BUILDINFO_PACKAGE}$REVISION"' -X '"${BUILDINFO_PACKAGE}$BUILDER"'" \
&& echo "Build flags: $LDFLAGS" \
&& echo "Fetching dependencies..." \
&& go get -u github.com/kardianos/govendor \
&& $GOPATH/bin/govendor sync \
&& curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh \
&& dep ensure -vendor-only \
&& go build -ldflags="${LDFLAGS}" \
&& mv ${PROJECT} /${PROJECT} \
&& apk del .build-dependencies \
Expand Down
199 changes: 199 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

[[constraint]]
name = "github.com/Financial-Times/go-fthealth"
version = "0.4.0"

[[constraint]]
name = "github.com/Financial-Times/go-logger"
version = "1.0.0"

[[constraint]]
name = "github.com/Financial-Times/message-queue-go-producer"
version = "0.2.0"

[[constraint]]
name = "github.com/Financial-Times/service-status-go"
version = "0.1.0"

[[constraint]]
name = "github.com/Financial-Times/transactionid-utils-go"
version = "0.2.0"

[[constraint]]
name = "github.com/Financial-Times/uuid-utils-go"
version = "1.0.1"

[[constraint]]
name = "github.com/Workiva/go-datastructures"
version = "1.0.43"

[[constraint]]
name = "github.com/gorilla/handlers"
version = "1.2.1"

[prune]
go-tests = true
unused-packages = true
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ Dependencies are:
Download the source code, dependencies and test dependencies:

go get -u github.com/kardianos/govendor
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
go get -u github.com/Financial-Times/content-collection-unfolder
cd $GOPATH/src/github.com/Financial-Times/content-collection-unfolder
govendor sync
dep ensure -vendor-only
go build .

## Running locally

1. Run the tests and install the binary:

govendor sync
govendor test -v -race
dep ensure -vendor-only
go test -v -race ./...
go install

2. Run the binary (using the `help` flag to see the available optional arguments):
Expand Down
2 changes: 1 addition & 1 deletion config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func TestDefaults(t *testing.T) {
app := cli.App("content-collection-unfolder", appDescription)
app := cli.App("content-collection-unfolder", serviceDescription)

sc := createServiceConfiguration(app)

Expand Down
Loading

0 comments on commit c8ec645

Please sign in to comment.