Add Goreleaser (#226)
This commit is contained in:
committed by
GitHub
parent
c83f961ffc
commit
a5d3455333
@@ -5,3 +5,6 @@
|
|||||||
# Golang
|
# Golang
|
||||||
/bin/*
|
/bin/*
|
||||||
/pkg/*
|
/pkg/*
|
||||||
|
|
||||||
|
# Builds
|
||||||
|
dist/
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
project_name: cameradar
|
||||||
|
dist: dist/cameradar
|
||||||
|
|
||||||
|
env:
|
||||||
|
- GO111MODULE=on
|
||||||
|
before:
|
||||||
|
hooks:
|
||||||
|
- go mod download
|
||||||
|
|
||||||
|
builds:
|
||||||
|
- binary: cameradar
|
||||||
|
main: ./cmd/cameradar
|
||||||
|
goos:
|
||||||
|
- windows
|
||||||
|
- darwin
|
||||||
|
- linux
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- 386
|
||||||
|
- arm
|
||||||
|
- arm64
|
||||||
|
goarm:
|
||||||
|
- 6
|
||||||
|
- 7
|
||||||
|
|
||||||
|
ignore:
|
||||||
|
- goos: darwin
|
||||||
|
goarch: 386
|
||||||
|
|
||||||
|
changelog:
|
||||||
|
skip: true
|
||||||
|
|
||||||
|
checksum:
|
||||||
|
name_template: "{{ .ProjectName }}_checksums.txt"
|
||||||
|
|
||||||
|
archives:
|
||||||
|
- name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}{{ if .Arm}}v{{ .Arm }}{{ end }}"
|
||||||
|
format: tar.gz
|
||||||
|
format_overrides:
|
||||||
|
- goos: windows
|
||||||
|
format: zip
|
||||||
|
files:
|
||||||
|
- CHANGELOG.md
|
||||||
+29
-2
@@ -2,8 +2,18 @@ dist: trusty
|
|||||||
sudo: required
|
sudo: required
|
||||||
language: go
|
language: go
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
# needed for the nfpm pipe:
|
||||||
|
- rpm
|
||||||
|
# needed for the snap pipe:
|
||||||
|
- snapd
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- GO111MODULE=on
|
- GO111MODULE=on
|
||||||
|
# needed for the snap pipe:
|
||||||
|
- PATH=/snap/bin:$PATH
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
@@ -23,12 +33,14 @@ before_install:
|
|||||||
- docker version
|
- docker version
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
# needed for the snap pipe:
|
||||||
|
- sudo snap install snapcraft --classic
|
||||||
- docker build -t cameradar .
|
- docker build -t cameradar .
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# Run unit tests
|
# Run unit tests
|
||||||
- go test -v -covermode=count -coverprofile=coverage.out
|
- GO111MODULE=on go test -v -covermode=count -coverprofile=coverage.out
|
||||||
- $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken=$COVERALLS_TOKEN
|
- GO111MODULE=on $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken=$COVERALLS_TOKEN
|
||||||
# Launch fake cameras to check if cameradar is able to access them
|
# Launch fake cameras to check if cameradar is able to access them
|
||||||
- docker run -d --name="fake_camera_digest" -e RTSP_ROUTE="/live.sdp" -e RTSP_USERNAME="admin" -e RTSP_PASSWORD="12345" -e RTSP_AUTHENTICATION_METHOD="digest" -p 8554:8554 ullaakut/rtspatt
|
- docker run -d --name="fake_camera_digest" -e RTSP_ROUTE="/live.sdp" -e RTSP_USERNAME="admin" -e RTSP_PASSWORD="12345" -e RTSP_AUTHENTICATION_METHOD="digest" -p 8554:8554 ullaakut/rtspatt
|
||||||
- docker run -d --name="fake_camera_basic" -e RTSP_ROUTE="/live.sdp" -e RTSP_USERNAME="root" -e RTSP_PASSWORD="root" -e RTSP_AUTHENTICATION_METHOD="digest" -p 5554:5554 ullaakut/rtspatt
|
- docker run -d --name="fake_camera_basic" -e RTSP_ROUTE="/live.sdp" -e RTSP_USERNAME="root" -e RTSP_PASSWORD="root" -e RTSP_AUTHENTICATION_METHOD="digest" -p 5554:5554 ullaakut/rtspatt
|
||||||
@@ -46,6 +58,21 @@ script:
|
|||||||
- cat logs.txt
|
- cat logs.txt
|
||||||
- grep "Successful attack" logs.txt || exit 1
|
- grep "Successful attack" logs.txt || exit 1
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
# You'll need to run `snapcraft export-login snap.login` and
|
||||||
|
# `travis encrypt-file snap.login --add` to add the key to the travis
|
||||||
|
# environment.
|
||||||
|
- test -n "$TRAVIS_TAG" && snapcraft login --with snap.login
|
||||||
|
|
||||||
|
# calls goreleaser
|
||||||
|
deploy:
|
||||||
|
- provider: script
|
||||||
|
skip_cleanup: true
|
||||||
|
script: curl -sL https://git.io/goreleaser | bash
|
||||||
|
on:
|
||||||
|
tags: true
|
||||||
|
condition: $TRAVIS_OS_NAME = linux
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
recipients:
|
recipients:
|
||||||
|
|||||||
Reference in New Issue
Block a user