Merge pull request #11 from jason-gao/master

增加 Makefile
master
Deng.Liu 2019-12-11 16:36:03 +08:00 committed by GitHub
commit 86ceb19acd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 8 deletions

2
.gitignore vendored
View File

@ -5,4 +5,4 @@ filegirl.yaml
fileboy-darwin-amd64.bin
fileboy-linux-amd64.bin
fileboy-windows-amd64.exe
./bin/*

View File

@ -5,11 +5,17 @@ go:
- 1.13.x
- master
script:
- go build
- ./fileboy version
- ./fileboy help
- ./fileboy init
- cat filegirl.yaml
- ./fileboy exec
dist: bionic # ubuntu 18.04
script:
- make init
- make build-linux
- ls bin
- ./bin/fileboy-linux-amd64.bin version
- ./bin/fileboy-linux-amd64.bin help
- ./bin/fileboy-linux-amd64.bin init
- cat filegirl.yaml
- ./bin/fileboy-linux-amd64.bin exec

41
Makefile Normal file
View File

@ -0,0 +1,41 @@
# notice
# Make is very picky about spaces vs. tabs.
# Command lines absolutely must be indented with a single tab, and not spaces.
# You may need to adjust your editor to generate tab characters.
# http://blog.chinaunix.net/uid/28458801/sid-171170-list-1.html
# use:
# make build-mac 编译
# make start-mac 启动
# make build-start-mac 编译+启动
init:
go get -u gopkg.in/yaml.v2
go get -u gopkg.in/fsnotify/fsnotify.v1
build-mac: ;@echo "编译-mac版";
CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -ldflags "-s -w" -o ./bin/fileboy-darwin-amd64.bin
build-linux: ;@echo "编译-linux版";
CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags "-s -w" -o ./bin/fileboy-linux-amd64.bin
build-win: ;@echo "编译-windows版";
CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -ldflags "-s -w" -o ./bin/fileboy-windows-amd64.exe
build-all: build-mac build-linux build-win
start-mac: ;@echo "启动服务";
./bin/fileboy-darwin-amd64.bin init
./bin/fileboy-darwin-amd64.bin
start-linux: ;@echo "启动服务";
./bin/fileboy-linux-amd64.bin init
./bin/fileboy-linux-amd64.bin
start-win: ;@echo "启动服务";
./bin/fileboy-windows-amd64.exe init
./bin/fileboy-windows-amd64.exe
build-start-mac: build-mac start-mac
.PHONY: build-mac build-linux build-win build-all start-linux travis-linux start-mac start-win build-start-mac

7
mergeUpstream.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
# 合并上游-fork来源
git remote add upstream https://github.com/dengsgo/fileboy.git
git fetch upstream
git checkout master
git merge upstream/master