-
Notifications
You must be signed in to change notification settings - Fork 29
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
Showing
3 changed files
with
52 additions
and
2 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
execd | ||
build | ||
release |
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,5 +1,33 @@ | ||
build: execd | ||
go build . | ||
NAME=execd | ||
OWNER=progrium | ||
ARCH=$(shell uname -m) | ||
VERSION=0.1.0 | ||
|
||
build: | ||
mkdir -p build/Linux && GOOS=linux CGO_ENABLED=0 go build -a \ | ||
-installsuffix cgo \ | ||
-o build/Linux/$(NAME) | ||
mkdir -p build/Darwin && GOOS=darwin CGO_ENABLED=0 go build -a \ | ||
-installsuffix cgo \ | ||
-o build/Darwin/$(NAME) | ||
|
||
deps: | ||
go get -u github.com/progrium/gh-release/... | ||
go get || true | ||
|
||
example: build | ||
./execd -h localhost -p 2022 -k example/host_pk.pem example/authcheck example/helloworld | ||
|
||
|
||
release: | ||
rm -rf release && mkdir release | ||
tar -zcf release/$(NAME)_$(VERSION)_Linux_$(ARCH).tgz -C build/Linux $(NAME) | ||
tar -zcf release/$(NAME)_$(VERSION)_Darwin_$(ARCH).tgz -C build/Darwin $(NAME) | ||
gh-release create $(OWNER)/$(NAME) $(VERSION) $(shell git rev-parse --abbrev-ref HEAD) v$(VERSION) | ||
|
||
circleci: | ||
rm ~/.gitconfig | ||
rm -rf /home/ubuntu/.go_workspace/src/github.com/$(OWNER)/$(NAME) && cd .. \ | ||
&& mkdir -p /home/ubuntu/.go_workspace/src/github.com/$(OWNER) \ | ||
&& mv $(NAME) /home/ubuntu/.go_workspace/src/github.com/$(OWNER)/$(NAME) \ | ||
&& ln -s /home/ubuntu/.go_workspace/src/github.com/$(OWNER)/$(NAME) $(NAME) |
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,20 @@ | ||
dependencies: | ||
pre: | ||
- make circleci | ||
override: | ||
- make deps | ||
- make build | ||
post: | ||
- tar -czvf $CIRCLE_ARTIFACTS/execd-linux.tgz -C build/Linux execd | ||
- tar -czvf $CIRCLE_ARTIFACTS/execd-darwin.tgz -C build/Darwin execd | ||
- tar -czvf $CIRCLE_ARTIFACTS/go-workspace.tgz -C ~/.go_workspace . | ||
|
||
test: | ||
override: | ||
- /bin/true | ||
|
||
deployment: | ||
release: | ||
branch: release | ||
commands: | ||
- make release |