-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge pull request #45 from Financial-Times/add-api-key-valid…
- Loading branch information
Sandor Torok
committed
Jul 14, 2017
1 parent
a6e7189
commit 8fa3893
Showing
8 changed files
with
54 additions
and
456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
/notifications-push-client | ||
/.env | ||
*.iml | ||
vendor/*/ | ||
|
||
/.project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
FROM golang:1.8-alpine | ||
FROM alpine:3.5 | ||
|
||
ENV PROJECT=notifications-push | ||
COPY . /${PROJECT}-sources/ | ||
COPY . .git /notifications-push/ | ||
|
||
RUN apk --no-cache --virtual .build-dependencies add git \ | ||
&& ORG_PATH="github.com/Financial-Times" \ | ||
&& REPO_PATH="${ORG_PATH}/${PROJECT}" \ | ||
&& mkdir -p $GOPATH/src/${ORG_PATH} \ | ||
# Linking the project sources in the GOPATH folder | ||
&& ln -s /${PROJECT}-sources $GOPATH/src/${REPO_PATH} \ | ||
RUN apk --update add git go libc-dev \ | ||
&& export GOPATH=/gopath \ | ||
&& REPO_PATH="github.com/Financial-Times/notifications-push" \ | ||
&& mkdir -p $GOPATH/src/${REPO_PATH} \ | ||
&& mv /notifications-push/* $GOPATH/src/${REPO_PATH} \ | ||
&& cd $GOPATH/src/${REPO_PATH} \ | ||
&& BUILDINFO_PACKAGE="${ORG_PATH}/${PROJECT}/vendor/${ORG_PATH}/service-status-go/buildinfo." \ | ||
&& BUILDINFO_PACKAGE="github.com/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/kardianos/govendor \ | ||
&& $GOPATH/bin/govendor sync \ | ||
&& echo $LDFLAGS \ | ||
&& go get -t ./... \ | ||
&& go build -ldflags="${LDFLAGS}" \ | ||
&& mv ${PROJECT} /${PROJECT}-app \ | ||
&& apk del .build-dependencies \ | ||
&& mv notifications-push /notifications-push-app \ | ||
&& rm -rf /notifications-push \ | ||
&& mv /notifications-push-app /notifications-push \ | ||
&& apk del go git libc-dev \ | ||
&& rm -rf $GOPATH /var/cache/apk/* | ||
|
||
WORKDIR / | ||
|
||
CMD [ "/notifications-push-app" ] | ||
CMD [ "/notifications-push" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
machine: | ||
environment: | ||
PROJECT_GOPATH: "${HOME}/.go_project" | ||
PROJECT_PARENT_PATH: "${PROJECT_GOPATH}/src/github.com/${CIRCLE_PROJECT_USERNAME}" | ||
PROJECT_PATH: "${PROJECT_PARENT_PATH}/${CIRCLE_PROJECT_REPONAME}" | ||
GOPATH: "${HOME}/.go_workspace:${PROJECT_GOPATH}" | ||
|
||
checkout: | ||
GODIST: "go1.7.3.linux-amd64.tar.gz" | ||
post: | ||
- mkdir -p "${PROJECT_PARENT_PATH}" | ||
- ln -sf "${HOME}/${CIRCLE_PROJECT_REPONAME}/" "${PROJECT_PATH}" | ||
|
||
- mkdir -p download | ||
- test -e download/$GODIST || curl -o download/$GODIST https://storage.googleapis.com/golang/$GODIST | ||
- sudo rm -rf /usr/local/go | ||
- sudo tar -C /usr/local -xzf download/$GODIST | ||
services: | ||
- docker | ||
dependencies: | ||
pre: | ||
- go get -u github.com/kardianos/govendor | ||
override: | ||
- cd $PROJECT_PATH && govendor sync | ||
- cd $PROJECT_PATH && go build -v | ||
|
||
- go get github.com/axw/gocov/gocov; go get github.com/matm/gocov-html; go get -u github.com/jstemmer/go-junit-report | ||
test: | ||
pre: | ||
- go get -u github.com/jstemmer/go-junit-report | ||
- go get -u github.com/mattn/goveralls | ||
- cd $PROJECT_PATH && wget https://raw.githubusercontent.com/Financial-Times/cookiecutter-upp-golang/master/coverage.sh && chmod +x coverage.sh | ||
- go get github.com/mattn/goveralls | ||
override: | ||
- mkdir -p $CIRCLE_TEST_REPORTS/golang | ||
- cd $PROJECT_PATH && govendor test -race -v +local | go-junit-report > $CIRCLE_TEST_REPORTS/golang/junit.xml | ||
- cd $PROJECT_PATH && ./coverage.sh | ||
- go test -race -v ./... | go-junit-report > $CIRCLE_TEST_REPORTS/golang/junit.xml | ||
- go test -v -cover -race -coverprofile=$CIRCLE_ARTIFACTS/consumer.out ./consumer | ||
- go test -v -cover -race -coverprofile=$CIRCLE_ARTIFACTS/dispatcher.out ./dispatcher | ||
- go test -v -cover -race -coverprofile=$CIRCLE_ARTIFACTS/resources.out ./resources | ||
- cd $CIRCLE_ARTIFACTS && sed -i '1d' *.out | ||
- | | ||
echo "mode: atomic" > $CIRCLE_ARTIFACTS/overall-coverage.result | ||
- cd $CIRCLE_ARTIFACTS && cat *.out >> overall-coverage.result | ||
- docker build --rm=false -t test/notifications-push . | ||
- docker run -d -p 9200:8080 test/notifications-push; sleep 3 | ||
- curl --retry 10 --retry-delay 5 -v http://localhost:9200/__health | ||
post: | ||
- goveralls -coverprofile=$CIRCLE_ARTIFACTS/coverage.out -service=circle-ci -repotoken=$COVERALLS_TOKEN | ||
- goveralls -coverprofile=$CIRCLE_ARTIFACTS/overall-coverage.result -service=circle-ci -repotoken=$COVERALLS_TOKEN | ||
- bash <(curl -s https://codecov.io/bash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.