Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use recommendations made from cryptopasta repository #630

Merged
merged 9 commits into from
Oct 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions .travis.yml → .circleci/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,33 @@
sudo: required

go_import_path: github.com/ory/hydra
language: go

cache:
directories:
- ./vendor/
go:
- 1.9

before_cache:
go_import_path: github.com/ory/hydra

services:
- docker

env:
- DOCKER_BIND_LOCALHOST=true DATABASE_URL=memory

language: go

go:
- 1.9
- DOCKER_BIND_LOCALHOST=true DATABASE_URL=memory DEP_VERSION="0.3.2"

before_install:
- curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep
- chmod +x $GOPATH/bin/dep
- sudo apt-get install curl

install:
- 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/Masterminds/glide github.com/mitchellh/gox github.com/ory/go-acc
- 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/mitchellh/gox github.com/ory/go-acc
- git clone https://github.com/docker-library/official-images.git ~/official-images
- glide install
- go install github.com/ory/hydra
- glide update
- dep ensure
- go install github.com/ory/hydra

script:
- ./scripts/test-format.sh
- go-acc -o coverage.txt $(glide novendor)
- go test -race -short $(glide novendor | grep -v cmd)
- go-acc -o coverage.txt ./...
- go test -race -short $(go list ./... | grep -v cmd)
- docker build -t hydra-travis-ci -f Dockerfile-without-telemetry .
- docker run -d hydra-travis-ci
- DATABASE_URL=memory hydra host --dangerous-auto-logon --dangerous-force-http --disable-telemetry &
Expand Down
181 changes: 181 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# 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/hydra
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

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/hydra
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/mattn/goveralls golang.org/x/tools/cmd/cover github.com/ory/go-acc
- run: dep ensure -vendor-only
- run: go install github.com/ory/hydra
- run: go-acc -o coverage.txt ./...
- run: go test -race -short $(go list ./... | grep -v cmd)
- run: ./scripts/test-e2e.sh
- run: goveralls -service=circle-ci -coverprofile=coverage.txt -repotoken=$COVERALLS_REPO_TOKEN

swagger:
docker:
- image: circleci/golang:1.9
working_directory: /go/src/github.com/ory/hydra
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: curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
- run: sudo apt-get install -y default-jre nodejs
- run: sudo npm i -g yarn
- run: yarn
- run: ./scripts/test-sdk.sh

build-docker-default:
docker:
- image: library/docker:17.10
steps:
- checkout
- setup_remote_docker
- run: docker build -f Dockerfile .

build-docker-http:
docker:
- image: library/docker:17.10
steps:
- checkout
- setup_remote_docker
- run: docker build -f Dockerfile-http .

build-docker-demo:
docker:
- image: library/docker:17.10
steps:
- checkout
- setup_remote_docker
- run: docker build -f Dockerfile-demo .

build-docker-automigrate:
docker:
- image: library/docker:17.10
steps:
- checkout
- setup_remote_docker
- run: docker build -f Dockerfile-automigrate .

build-docker-without-telemetry:
docker:
- image: library/docker:17.10
steps:
- checkout
- setup_remote_docker
- run: docker build -t hydra-travis-ci -f Dockerfile-without-telemetry .
- run: docker run -d hydra-travis-ci

build:
docker:
- image: circleci/golang:1.9
working_directory: /go/src/github.com/ory/hydra
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/mitchellh/gox github.com/tcnksm/ghr
- run: dep ensure -vendor-only
- run: sudo apt-get install -y nodejs
- run: ./scripts/run-deploy.sh
- run: ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace `git describe --tags` dist/
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: npm publish

workflows:
version: 2
"test, build, push, and deploy":
jobs:
- format:
filters:
tags:
only: /.*/
- test:
filters:
tags:
only: /.*/
- swagger:
filters:
tags:
only: /.*/
- build-docker-default:
requires:
- test
- swagger
- format
filters:
tags:
only: /.*/
- build-docker-http:
requires:
- test
- swagger
- format
filters:
tags:
only: /.*/
- build-docker-demo:
requires:
- test
- swagger
- format
filters:
tags:
only: /.*/
- build-docker-automigrate:
requires:
- test
- swagger
- format
filters:
tags:
only: /.*/
- build-docker-without-telemetry:
requires:
- test
- swagger
- format
filters:
tags:
only: /.*/
- build:
requires:
- build-docker-without-telemetry
- build-docker-demo
- build-docker-automigrate
- build-docker-http
- build-docker-default
filters:
tags:
only: /.*/
branches:
ignore: /.*/
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
FROM golang:1.9-alpine

RUN apk add --no-cache git build-base
RUN go get github.com/Masterminds/glide
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/hydra

ADD ./glide.yaml ./glide.yaml
ADD ./glide.lock ./glide.lock
RUN glide install --skip-test -v
ADD ./Gopkg.lock ./Gopkg.lock
ADD ./Gopkg.toml ./Gopkg.toml
RUN dep ensure -vendor-only

ADD . .
RUN go install .

ENTRYPOINT /go/bin/hydra host

EXPOSE 4444
EXPOSE 4444
13 changes: 8 additions & 5 deletions Dockerfile-automigrate
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM golang:1.9-alpine

RUN apk add --no-cache git build-base
RUN go get github.com/Masterminds/glide
RUN apk add --no-cache git build-base curl
ENV DEP_VERSION 0.3.2
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/hydra

ADD ./glide.yaml ./glide.yaml
ADD ./glide.lock ./glide.lock
RUN glide install --skip-test -v
ADD ./Gopkg.lock ./Gopkg.lock
ADD ./Gopkg.toml ./Gopkg.toml
RUN dep ensure -vendor-only

ADD . .
RUN go install .
Expand Down
13 changes: 8 additions & 5 deletions Dockerfile-demo
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM golang:1.9-alpine

RUN apk add --no-cache git build-base
RUN go get github.com/Masterminds/glide
RUN apk add --no-cache git build-base curl
ENV DEP_VERSION 0.3.2
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/hydra

ADD ./glide.yaml ./glide.yaml
ADD ./glide.lock ./glide.lock
RUN glide install --skip-test -v
ADD ./Gopkg.lock ./Gopkg.lock
ADD ./Gopkg.toml ./Gopkg.toml
RUN dep ensure -vendor-only

ADD . .
RUN go install .
Expand Down
13 changes: 8 additions & 5 deletions Dockerfile-http
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM golang:1.9-alpine

RUN apk add --no-cache git build-base
RUN go get github.com/Masterminds/glide
RUN apk add --no-cache git build-base curl
ENV DEP_VERSION 0.3.2
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/hydra

ADD ./glide.yaml ./glide.yaml
ADD ./glide.lock ./glide.lock
RUN glide install --skip-test -v
ADD ./Gopkg.lock ./Gopkg.lock
ADD ./Gopkg.toml ./Gopkg.toml
RUN dep ensure -vendor-only

ADD . .
RUN go install .
Expand Down
13 changes: 8 additions & 5 deletions Dockerfile-without-telemetry
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM golang:1.9-alpine

RUN apk add --no-cache git build-base
RUN go get github.com/Masterminds/glide
RUN apk add --no-cache git build-base curl
ENV DEP_VERSION 0.3.2
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/hydra

ADD ./glide.yaml ./glide.yaml
ADD ./glide.lock ./glide.lock
RUN glide install --skip-test -v
ADD ./Gopkg.lock ./Gopkg.lock
ADD ./Gopkg.toml ./Gopkg.toml
RUN dep ensure -vendor-only

ADD . .
RUN go install .
Expand Down
Loading