Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Commit

Permalink
Decom authors and update app/CI (#28)
Browse files Browse the repository at this point in the history
* 🔧 Remove config for authors workflow

* 🚨 S/sirupsen!!!

* 👷 Convert to CircleCI 2

* 👷 Convert to use dep instead of govendor

* Added docker build to CircleCI
  • Loading branch information
David Smith committed Apr 3, 2018
1 parent e216ffe commit 3d0768a
Show file tree
Hide file tree
Showing 9 changed files with 240 additions and 147 deletions.
61 changes: 61 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
version: 2
jobs:
build:
docker:
- image: circleci/golang:1.10
working_directory: /go/src/github.com/Financial-Times/concept-ingester
environment:
CIRCLE_TEST_REPORTS: /tmp/test-reports
CIRCLE_ARTIFACTS: /tmp/artifacts
steps:
- checkout
- run:
name: Create folders
command: |
mkdir -p $CIRCLE_TEST_REPORTS/golang
mkdir -p $CIRCLE_ARTIFACTS
- run:
name: Download dependancies
command: |
go get -u github.com/golang/dep/cmd/dep
go get -u github.com/jstemmer/go-junit-report
go get -u github.com/mattn/goveralls
- run:
name: Download vendored dependancies
command: |
dep ensure
- run:
name: Build app
command: |
go build -v
- run:
name: Run tests and create coverage report
command: |
go test -race -cover -coverprofile=$CIRCLE_ARTIFACTS/coverage.out | go-junit-report > $CIRCLE_TEST_REPORTS/golang/junit.xml
- run:
name: Upload coverage report
command: |
goveralls -coverprofile=$CIRCLE_ARTIFACTS/coverage.out -service=circle-ci -repotoken=$COVERALLS_TOKEN
- store_test_results:
path: /tmp/test-reports
- store_artifacts:
path: /tmp/artifacts
destination: build
docker_build:
working_directory: /concept-ingester
docker:
- image: docker:18.03
steps:
- checkout
- setup_docker_engine
- run:
name: Build Dockerfile
command: docker build .
workflows:
version: 2
tests_and_docker:
jobs:
- build
- docker_build:
requires:
- build
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Folders
_obj
_test
vendor/*/
vendor/

# Architecture specific extensions/prefixes
*.[568vq]
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.8-alpine
FROM golang:1.10-alpine

ENV PROJECT=concept-ingester
COPY . /${PROJECT}-sources/
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 \
&& go get -u github.com/golang/dep/cmd/dep \
&& $GOPATH/bin/dep ensure \
&& go build -ldflags="${LDFLAGS}" \
&& mv ${PROJECT} /${PROJECT} \
&& apk del .build-dependencies \
Expand Down
118 changes: 118 additions & 0 deletions Gopkg.lock

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

54 changes: 54 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#
# [prune]
# non-go = false
# go-tests = true
# unused-packages = true


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

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

[[constraint]]
name = "github.com/Financial-Times/message-queue-gonsumer"
version = "0.4.0"

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

[[constraint]]
branch = "master"
name = "github.com/cyberdelia/go-metrics-graphite"

[[constraint]]
name = "github.com/sirupsen/logrus"
version = "1.0.5"

[prune]
go-tests = true
unused-packages = true
30 changes: 0 additions & 30 deletions circle.yml

This file was deleted.

2 changes: 1 addition & 1 deletion helm/concept-ingester/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
- name: TOPIC
value: "Concept"
- name: SERVICES
value: "http://people-rw-neo4j:8080,http://organisations-rw-neo4j:8080,http://memberships-rw-neo4j:8080"
value: "http://organisations-rw-neo4j:8080"
- name: ELASTICSEARCH_WRITER
value: "http://concept-rw-elasticsearch:8080"
- name: GRAPHITE_TCP_AUTHORITY
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ import (
"syscall"
"time"

"github.com/Financial-Times/http-handlers-go/httphandlers"
queueConsumer "github.com/Financial-Times/message-queue-gonsumer/consumer"
status "github.com/Financial-Times/service-status-go/httphandlers"
log "github.com/Sirupsen/logrus"
"github.com/cyberdelia/go-metrics-graphite"
"github.com/gorilla/mux"
"github.com/jawher/mow.cli"
"github.com/rcrowley/go-metrics"
"github.com/Financial-Times/http-handlers-go/httphandlers"
log "github.com/sirupsen/logrus"
)

func main() {
Expand Down
Loading

0 comments on commit 3d0768a

Please sign in to comment.