mirror of
https://github.com/shouptech/tempgopher.git
synced 2026-02-03 16:49:42 +00:00
Moved to GitLab and setup CI
* Renamed temp-gopher references to tempgopher * Added to GitLab CI
This commit is contained in:
parent
047c605d00
commit
c37d491e86
3 changed files with 42 additions and 6 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
# Things
|
# Things
|
||||||
temp-gopher
|
tempgopher
|
||||||
*~
|
*~
|
||||||
*.swp
|
*.swp
|
||||||
|
|
||||||
|
|
|
||||||
36
.gitlab-ci.yml
Normal file
36
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
image: golang:1.11
|
||||||
|
|
||||||
|
variables:
|
||||||
|
binary_name: tempgopher
|
||||||
|
project_prefix: gitlab.com/shouptech
|
||||||
|
project_path: $project_prefix/tempgopher
|
||||||
|
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
- build
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- mkdir -p ${GOPATH}/src/${project_prefix}
|
||||||
|
- cp -r ${CI_PROJECT_DIR} ${GOPATH}/src/${project_path}
|
||||||
|
- cd ${GOPATH}/src/${project_path}
|
||||||
|
- go get -v ./...
|
||||||
|
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
variables:
|
||||||
|
GIN_MODE: debug
|
||||||
|
script:
|
||||||
|
- go get -v -t ./...
|
||||||
|
- go test -v
|
||||||
|
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
variables:
|
||||||
|
build_binary: $CI_PROJECT_DIR/${binary_name}
|
||||||
|
script:
|
||||||
|
- go get -v github.com/gobuffalo/packr/...
|
||||||
|
- GOOS=linux GOARCH=arm GOARM=6 packr build -v -a -ldflags '-s -w -extldflags "-static"' -o ${build_binary}
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- tempgopher
|
||||||
10
README.md
10
README.md
|
|
@ -17,10 +17,10 @@ You can build on a Raspberry Pi, however, it can take a long time! I recommend b
|
||||||
|
|
||||||
```
|
```
|
||||||
go get -u github.com/gobuffalo/packr/...
|
go get -u github.com/gobuffalo/packr/...
|
||||||
go get gitea.shoup.io/mike/temp-gopher
|
go get gitea.shoup.io/mike/tempgopher
|
||||||
cd $GOPATH/src/gitea.shoup.io/mike/temp-gopher
|
cd $GOPATH/src/gitea.shoup.io/mike/tempgopher
|
||||||
GOOS=linux GOARCH=arm GOARM=6 packr build -a -ldflags '-w -s -extldflags "-static"'
|
GOOS=linux GOARCH=arm GOARM=6 packr build -a -ldflags '-w -s -extldflags "-static"'
|
||||||
scp temp-gopher <raspberrypi>:~/somepath
|
scp tempgopher <raspberrypi>:~/somepath
|
||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
@ -49,13 +49,13 @@ sensors:
|
||||||
You can run it directly in the comment line like:
|
You can run it directly in the comment line like:
|
||||||
|
|
||||||
```
|
```
|
||||||
./temp-gopher -c config.yml run
|
./tempgopher -c config.yml run
|
||||||
```
|
```
|
||||||
|
|
||||||
You can run it in the background using `nohup`:
|
You can run it in the background using `nohup`:
|
||||||
|
|
||||||
```
|
```
|
||||||
nohup ./temp-gopher -c config.yml run &
|
nohup ./tempgopher -c config.yml run &
|
||||||
```
|
```
|
||||||
|
|
||||||
Or use `systemctl` or some other process supervisor to run it.
|
Or use `systemctl` or some other process supervisor to run it.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue