-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
arekkas
committed
Apr 19, 2018
1 parent
4f00bc9
commit a592e51
Showing
327 changed files
with
30,288 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,152 @@ | ||
# Golang CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-go/ for more details | ||
version: 2 | ||
jobs: | ||
format: | ||
docker: | ||
- image: circleci/golang:1.9 | ||
working_directory: /go/src/github.com/ory/keto | ||
steps: | ||
- checkout | ||
- run: curl -L -s https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 -o /go/bin/dep && chmod +x /go/bin/dep | ||
- run: go get -u golang.org/x/tools/cmd/goimports | ||
- run: dep ensure -vendor-only | ||
- run: ./scripts/test-format.sh | ||
|
||
swagger: | ||
docker: | ||
- image: circleci/golang:1.9 | ||
working_directory: /go/src/github.com/ory/keto | ||
steps: | ||
- checkout | ||
- run: curl -L -s https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 -o /go/bin/dep && chmod +x /go/bin/dep | ||
- run: go get -u github.com/go-swagger/go-swagger/cmd/swagger golang.org/x/tools/cmd/goimports | ||
- run: dep ensure -vendor-only | ||
- run: ./scripts/run-genswag.sh | ||
|
||
test: | ||
docker: | ||
- image: circleci/golang:1.9 | ||
environment: | ||
- TEST_DATABASE_POSTGRESQL=postgres://test:test@localhost:5432/hydra?sslmode=disable | ||
- TEST_DATABASE_MYSQL=root:test@(localhost:3306)/mysql?parseTime=true | ||
- image: postgres:9.5 | ||
environment: | ||
- POSTGRES_USER=test | ||
- POSTGRES_PASSWORD=test | ||
- POSTGRES_DB=hydra | ||
- image: mysql:5.7 | ||
environment: | ||
- MYSQL_ROOT_PASSWORD=test | ||
working_directory: /go/src/github.com/ory/keto | ||
steps: | ||
- checkout | ||
- run: go get -u github.com/go-swagger/go-swagger/cmd/swagger github.com/bradfitz/goimports github.com/mattn/goveralls golang.org/x/tools/cmd/cover github.com/ory/go-acc | ||
- run: curl -L -s https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 -o /go/bin/dep && chmod +x /go/bin/dep | ||
|
||
# Installation | ||
- run: curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - | ||
- run: dep ensure -vendor-only | ||
- run: go install github.com/ory/keto | ||
|
||
# Tests | ||
- run: go-acc -o coverage.txt $(glide novendor) | ||
- run: go test -race -short $(glide novendor | grep -v cmd) | ||
|
||
# Submit coverage details | ||
# - run: goveralls -service=circle-ci -coverprofile=coverage.txt -repotoken=$COVERALLS_REPO_TOKEN | ||
|
||
test-docker: | ||
docker: | ||
- image: library/docker:17.10 | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
version: 17.10.0-ce | ||
- run: docker build -f Dockerfile -t keto-test . | ||
- run: docker run keto-test version | ||
|
||
release: | ||
docker: | ||
- image: circleci/golang:1.9 | ||
working_directory: /go/src/github.com/ory/keto | ||
steps: | ||
- checkout | ||
- setup_remote_docker: | ||
version: 17.10.0-ce | ||
- run: docker build --build-arg git_tag=$(git describe --tags) --build-arg git_commit=$(git rev-parse HEAD) -f Dockerfile -t oryd/keto:$CIRCLE_TAG . | ||
- run: docker login --username "$DOCKER_USERNAME" --password "$DOCKER_PASSWORD" | ||
- run: docker push oryd/keto:$CIRCLE_TAG | ||
|
||
publish-docs: | ||
docker: | ||
- image: alpine/git:1.0.4 | ||
working_directory: /go/src/github.com/ory/keto | ||
steps: | ||
- checkout | ||
- run: git config --global user.email "[email protected]" | ||
- run: git config --global user.name "ORY Continuous Integration" | ||
- run: "git clone https://arekkas:[email protected]/ory/docs.git ../docs" | ||
- run: "cp ./docs/api.swagger.json ../docs/apis/keto.json" | ||
- run: "(cd ../docs && git add -A && git commit -a -m \"Updates ORY Keto Swagger definitions\" && git push origin) || exit 0" | ||
|
||
changelog: | ||
docker: | ||
- image: circleci/ruby:2.4-node | ||
steps: | ||
- checkout | ||
- run: gem install github_changelog_generator | ||
- run: sudo npm i -g doctoc | ||
- run: github_changelog_generator -u ory -p hydra -o CHANGELOG.md --token $GITHUB_TOKEN | ||
- run: doctoc CHANGELOG.md | ||
- run: doctoc README.md | ||
- run: git config --global user.email "[email protected]" | ||
- run: git config --global user.name "ORY Continuous Integration" | ||
- run: git add CHANGELOG.md | ||
- run: | | ||
git commit -m "docs: Incorporates changes from version $(git describe --tags)" -- CHANGELOG.md | ||
- run: git remote rm origin | ||
- run: git remote add origin https://arekkas:[email protected]/ory/keto.git | ||
- run: git push origin HEAD:master | ||
|
||
workflows: | ||
version: 2 | ||
"test, build, and relase": | ||
jobs: | ||
- format: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- test: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- swagger: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- publish-docs: | ||
filters: | ||
branches: | ||
only: master | ||
- changelog: | ||
filters: | ||
branches: | ||
only: master | ||
- test-docker: | ||
requires: | ||
- test | ||
- swagger | ||
- format | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- release: | ||
requires: | ||
- test-docker | ||
filters: | ||
tags: | ||
only: /.*/ | ||
branches: | ||
ignore: /.*/ |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules/ | ||
vendor/ | ||
.idea/ |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM golang:1.9-alpine | ||
|
||
ARG git_tag | ||
ARG git_commit | ||
|
||
RUN apk add --no-cache git build-base curl | ||
RUN curl -L -s https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 -o $GOPATH/bin/dep | ||
RUN chmod +x $GOPATH/bin/dep | ||
|
||
WORKDIR /go/src/github.com/ory/keto | ||
|
||
ADD ./Gopkg.lock ./Gopkg.lock | ||
ADD ./Gopkg.toml ./Gopkg.toml | ||
RUN dep ensure -vendor-only | ||
|
||
ADD . . | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -X github.com/ory/keto/cmd.Version=$git_tag -X github.com/ory/keto/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/keto/cmd.GitHash=$git_commit" -a -installsuffix cgo -o keto | ||
|
||
FROM scratch | ||
|
||
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=0 /go/src/github.com/ory/keto/keto /usr/bin/keto | ||
|
||
ENTRYPOINT ["keto"] | ||
|
||
CMD ["serve"] |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM golang:1.9-alpine | ||
|
||
ARG git_tag | ||
ARG git_commit | ||
|
||
RUN apk add --no-cache git build-base curl | ||
RUN curl -L -s https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 -o $GOPATH/bin/dep | ||
RUN chmod +x $GOPATH/bin/dep | ||
|
||
WORKDIR /go/src/github.com/ory/keto | ||
|
||
ADD ./Gopkg.lock ./Gopkg.lock | ||
ADD ./Gopkg.toml ./Gopkg.toml | ||
RUN dep ensure -vendor-only | ||
|
||
ADD . . | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -X github.com/ory/keto/cmd.Version=$git_tag -X github.com/ory/keto/cmd.BuildTime=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/keto/cmd.GitHash=$git_commit" -a -installsuffix cgo -o keto | ||
|
||
FROM alpine:3.7 | ||
|
||
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=0 /go/src/github.com/ory/keto/keto /usr/bin/keto | ||
|
||
ENTRYPOINT ["keto"] | ||
|
||
CMD ["serve"] |
Oops, something went wrong.