Skip to content

Commit e88ba56

Browse files
authored
Merge pull request #21 from theckman/use_Makefile
Add Makefile for ease of testing, building, and releasing
2 parents 99f4aee + 844d457 commit e88ba56

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Misc
22
*.swp
3+
4+
# cronner-specific paths or files
35
cronner
6+
cronner-*
7+
build/
48

59
# Compiled Object files, Static and Dynamic libs (Shared Objects)
610
*.o

.travis.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@ notifications:
1111
on_success: never
1212
on_failure: always
1313
env: 'PROJECT_NAME=cronner GOARCH=amd64 GOOS=linux PROJECT_BUILD_NAME="$PROJECT_NAME-$GOOS-$GOARCH-$TRAVIS_TAG"'
14-
install: go get -u github.com/golang/dep/cmd/dep
14+
install: true
1515
before_script:
1616
- rm -rf ${GOPATH}/pkg/*
17-
script: go test -v -check.vv ./...
17+
script: make test
1818
before_deploy:
19-
- mkdir build
20-
- mkdir $PROJECT_BUILD_NAME
21-
- go build -o $PROJECT_BUILD_NAME/$PROJECT_NAME
22-
- tar -czf build/$PROJECT_BUILD_NAME.tar.gz $PROJECT_BUILD_NAME/
23-
- shasum -a 256 -- build/$PROJECT_BUILD_NAME.tar.gz | sed -e 's#build/##g' > build/$PROJECT_BUILD_NAME.tar.gz.sha256
19+
- make prep-deploy
2420
deploy:
2521
provider: releases
2622
skip_cleanup: true

Makefile

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
dep:
2+
go get -u github.com/golang/dep/cmd/dep
3+
4+
test:
5+
go test -v -check.vv ./...
6+
7+
build: test
8+
go build -o cronner .
9+
10+
prep-deploy:
11+
mkdir build
12+
mkdir ${PROJECT_BUILD_NAME}
13+
go build -o ${PROJECT_BUILD_NAME}/${PROJECT_NAME}
14+
tar -czf build/${PROJECT_BUILD_NAME}.tar.gz ${PROJECT_BUILD_NAME}/
15+
shasum -a 256 -- build/${PROJECT_BUILD_NAME}.tar.gz | sed -e 's#build/##g' > build/${PROJECT_BUILD_NAME}.tar.gz.sha256
16+
rm -rf ${PROJECT_BUILD_NAME}
17+
18+
.PHONY: dep test build prep-deploy

0 commit comments

Comments
 (0)