Skip to content

Commit

Permalink
dist: Fix packr build pipeline (#84)
Browse files Browse the repository at this point in the history
Closes #73 
Closes #81

Signed-off-by: aeneasr <aeneas@ory.sh>
  • Loading branch information
aeneasr committed Feb 5, 2019
1 parent 7798442 commit 65a87d5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ jobs:
echo 'export GO111MODULE=on' >> $BASH_ENV
source $BASH_ENV
- checkout
- run: go get -u github.com/mitchellh/gox github.com/tcnksm/ghr
- run: GO111MODULE=off go get -u github.com/mitchellh/gox github.com/tcnksm/ghr github.com/gobuffalo/packr/packr
- run: packr
- run: |
gox -parallel=2 -ldflags "-X github.com/ory/keto/cmd.Version=`git describe --tags` -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 rev-parse HEAD`" -output "dist/{{.Dir}}-{{.OS}}-{{.Arch}}";
- run: packr clean
- run: ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace `git describe --tags` dist/

workflows:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apk add --no-cache git build-base

WORKDIR /go/src/github.com/ory/keto

RUN go get -u github.com/gobuffalo/packr/packr
RUN GO111MODULE=off go get -u github.com/gobuffalo/packr/packr

ENV GO111MODULE=on

Expand Down
3 changes: 1 addition & 2 deletions Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ RUN apk add --no-cache git build-base

WORKDIR /go/src/github.com/ory/keto

RUN go get -u github.com/gobuffalo/packr/packr
RUN GO111MODULE=off go get -u github.com/gobuffalo/packr/packr

RUN export GO111MODULE=on


ADD go.mod go.mod
ADD go.sum go.sum

Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
init:
go get -u \
GO111MODULE=off go get -u \
github.com/ory/x/tools/listx \
github.com/sqs/goreturns \
github.com/go-swagger/go-swagger/cmd/swagger
github.com/go-swagger/go-swagger/cmd/swagger \
github.com/gobuffalo/packr/packr

format:
goreturns -w -local github.com/ory $$(listx .)
Expand Down Expand Up @@ -33,10 +34,14 @@ build-sdk:
install-stable:
KETO_LATEST=$$(git describe --abbrev=0 --tags)
git checkout $$KETO_LATEST
$(go env GOPATH)/bin/packr
GO111MODULE=on go install \
-ldflags "-X github.com/ory/keto/cmd.Version=$$KETO_LATEST -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 rev-parse HEAD`" \
.
$(go env GOPATH)/bin/packr clean
git checkout master

install:
$(go env GOPATH)/bin/packr
GO111MODULE=on go install .
$(go env GOPATH)/bin/packr clean
1 change: 1 addition & 0 deletions cmd/server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*-packr.go

0 comments on commit 65a87d5

Please sign in to comment.