Skip to content

Commit

Permalink
Merge pull request #26 from Financial-Times/feature/pac-categories
Browse files Browse the repository at this point in the history
Added annotations-curation category for PAC + dep
  • Loading branch information
izzyblues authored Apr 5, 2018
2 parents 085d95d + 0d388fa commit 4a4537f
Show file tree
Hide file tree
Showing 10 changed files with 539 additions and 542 deletions.
32 changes: 15 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,37 @@ jobs:
build:
working_directory: /go/src/github.com/Financial-Times/upp-aggregate-healthcheck
docker:
- image: golang:1.8.3
environment:
GOPATH: /go
CIRCLE_TEST_REPORTS: /tmp/test-results
CIRCLE_COVERAGE_REPORT: /tmp/coverage-results
- image: circleci/golang:1.9
environment:
CIRCLE_TEST_REPORTS: /tmp/test-results
CIRCLE_COVERAGE_REPORT: /tmp/coverage-results
steps:
- checkout
- run:
name: Make go get work
command: sudo chown -R circleci:circleci /go/src
- run:
name: External Dependencies
command: |
go get -u github.com/golang/dep/cmd/dep
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
- run:
name: Test Results
command: |
mkdir -p ${CIRCLE_TEST_REPORTS}
mkdir -p ${CIRCLE_COVERAGE_REPORT}
- run:
name: Govendor Sync
command: govendor sync -v
name: Import libraries
command: dep ensure
- run:
name: Go Build
command: go build -v
- 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 ./...
mkdir -p ${CIRCLE_TEST_REPORTS}/golang
mkdir -p ${CIRCLE_COVERAGE_REPORT}
go test -race -v | go-junit-report > $CIRCLE_TEST_REPORTS/golang/junit.xml
go test -race -cover -coverprofile=$CIRCLE_COVERAGE_REPORT/coverage.out
- 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_REPORT}/coverage.out -service=circle-ci -repotoken=$COVERALLS_TOKEN
- store_test_results:
path: /tmp/test-results
dockerfile:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/upp-aggregate-healthcheck
vendor/*/
vendor/
*.idea
*.exe
/.project
Expand Down
45 changes: 28 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
FROM golang:1.7-alpine3.5
FROM golang:1.9-alpine

RUN mkdir -p /upp-aggregate-healthcheck

ADD . "$GOPATH/src/upp-aggregate-healthcheck"
ENV PROJECT=upp-aggregate-healthcheck
COPY . /${PROJECT}-sources/

RUN apk --no-cache --virtual .build-dependencies add git \
&& cd $GOPATH/src/upp-aggregate-healthcheck \
&& go get -u github.com/kardianos/govendor \
&& $GOPATH/bin/govendor sync \
&& go-wrapper download \
&& go-wrapper install \
&& ls -la $GOPATH \
&& cp -R resources /upp-aggregate-healthcheck/ \
&& cp -R html-templates /upp-aggregate-healthcheck/ \
&& ORG_PATH="github.com/Financial-Times" \
&& REPO_PATH="Financial-Times/${PROJECT}" \
&& mkdir -p $GOPATH/src/Financial-Times \
# Linking the project sources in the GOPATH folder
&& ln -s /${PROJECT}-sources $GOPATH/src/${REPO_PATH} \
&& cd $GOPATH/src/${REPO_PATH} \
&& BUILDINFO_PACKAGE="Financial-Times/${PROJECT}/vendor/Financial-Times/service-status-go/buildinfo." \
&& VERSION="version=$(git describe --tag --always 2> /dev/null)" \
&& DATETIME="dateTime=$(date -u +%Y%m%d%H%M%S)" \
&& REPOSITORY="repository=$(git config --get remote.origin.url)" \
&& REVISION="revision=$(git rev-parse HEAD)" \
&& BUILDER="builder=$(go version)" \
&& 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/golang/dep/cmd/dep \
&& $GOPATH/bin/dep ensure \
&& go build -ldflags="${LDFLAGS}" \
&& mv ${PROJECT} /${PROJECT} \
&& mv /${PROJECT}-sources/resources /resources \
&& mv /${PROJECT}-sources/html-templates /html-templates \
&& rm -r /${PROJECT}-sources \
&& apk del .build-dependencies \
&& rm -rf $GOPATH/src $GOPATH/pkg

WORKDIR /upp-aggregate-healthcheck
&& rm -rf $GOPATH /var/cache/apk/*

EXPOSE 8080
WORKDIR /

CMD ["go-wrapper", "run"]
CMD [ "/upp-aggregate-healthcheck" ]
Loading

0 comments on commit 4a4537f

Please sign in to comment.