diff --git a/Makefile b/Makefile index 378058f06c7..95cdaeac081 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,11 @@ lint: .bin/golangci-lint # Runs full test suite including tests where databases are enabled .PHONY: test-legacy-migrations -test-legacy-migrations: test-resetdb sqlbin +test-legacy-migrations: test-resetdb .bin/go-bindata + cd internal/fizzmigrate/client; go-bindata -o sql_migration_files.go -pkg client ./migrations/sql/... + cd internal/fizzmigrate/consent; go-bindata -o sql_migration_files.go -pkg consent ./migrations/sql/... + cd internal/fizzmigrate/jwk; go-bindata -o sql_migration_files.go -pkg jwk ./migrations/sql/... + cd internal/fizzmigrate/oauth2; go-bindata -o sql_migration_files.go -pkg oauth2 ./migrations/sql/... source scripts/test-env.sh && go test -tags legacy_migration_test sqlite -failfast -timeout=20m ./internal/fizzmigrate docker rm -f hydra_test_database_mysql docker rm -f hydra_test_database_postgres @@ -69,13 +73,8 @@ test-resetdb: node_modules # Runs tests in short mode, without database adapters .PHONY: docker -docker: .bin/packr2 - packr2 - GO111MODULE=on GOOS=linux GOARCH=amd64 go build -tags sqlite - packr2 clean - docker build -t oryd/hydra:latest . - docker build -f Dockerfile-alpine -t oryd/hydra:latest-alpine . - rm hydra +docker: + docker build -f .docker/Dockerfile-build -t oryd/hydra:latest-sqlite . .PHONY: e2e e2e: node_modules test-resetdb @@ -105,18 +104,6 @@ format: .bin/goreturns node_modules mocks: .bin/mockgen mockgen -package oauth2_test -destination oauth2/oauth2_provider_mock_test.go github.com/ory/fosite OAuth2Provider -# Adds sql files to the binary using go-bindata -.PHONY: sqlbin -sqlbin: .bin/go-bindata - cd internal/fizzmigrate/client; go-bindata -o sql_migration_files.go -pkg client ./migrations/sql/... - cd internal/fizzmigrate/consent; go-bindata -o sql_migration_files.go -pkg consent ./migrations/sql/... - cd internal/fizzmigrate/jwk; go-bindata -o sql_migration_files.go -pkg jwk ./migrations/sql/... - cd internal/fizzmigrate/oauth2; go-bindata -o sql_migration_files.go -pkg oauth2 ./migrations/sql/... - -# Runs all code generators -.PHONY: gen -gen: mocks sqlbin sdk - # Generates the SDKs .PHONY: sdk sdk: .bin/cli @@ -129,12 +116,11 @@ sdk: .bin/cli swagger generate client -f ./.schema/api.swagger.json -t internal/httpclient -A Ory_Hydra make format - .PHONY: install-stable -install-stable: .bin/packr2 +install-stable: HYDRA_LATEST=$$(git describe --abbrev=0 --tags) git checkout $$HYDRA_LATEST - packr2 + make pack GO111MODULE=on go install \ -tags sqlite \ -ldflags "-X github.com/ory/hydra/cmd.Version=$$HYDRA_LATEST -X github.com/ory/hydra/cmd.Date=`TZ=UTC date -u '+%Y-%m-%dT%H:%M:%SZ'` -X github.com/ory/hydra/cmd.Commit=`git rev-parse HEAD`" \ @@ -143,7 +129,10 @@ install-stable: .bin/packr2 git checkout master .PHONY: install -install: .bin/packr2 - packr2 +install: pack GO111MODULE=on go install -tags sqlite . packr2 clean + +.PHONY: pack +pack: .bin/packr2 + packr2