From fcc5f5ab88d4315f1ba4161d978f53c8d3bce911 Mon Sep 17 00:00:00 2001 From: Julian Kornberger Date: Thu, 16 Aug 2018 01:13:28 +0200 Subject: [PATCH 1/2] Add Circle CI --- .circleci/config.yml | 19 +++++++++++++++++++ README.md | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..ec196dc --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,19 @@ +# Golang CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-go/ for more details +version: 2 +jobs: + build: + docker: + # specify the version + - image: circleci/golang:1.10 + + working_directory: /go/src/github.com/gonicus/gofaxip + steps: + - checkout + + # specify any bash command here prefixed with `run: ` + - run: go get -v -t -d ./... + - run: go test -v ./... + - run: go install github.com/gonicus/gofaxip/gofaxsend + - run: go install github.com/gonicus/gofaxip/gofaxd diff --git a/README.md b/README.md index 554d78a..240b6fe 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # GOfax.IP + [![CircleCI](https://circleci.com/gh/gonicus/gofaxip/tree/master.svg?style=shield)](https://circleci.com/gh/gonicus/gofaxip/tree/master) + GOfax.IP is a HylaFAX backend/connector providing Fax over IP support for HylaFAX using FreeSWITCH and SpanDSP through FreeSWITCH's mod_spandsp. In contrast to solutions like t38modem, iaxmodem and mod_spandsp's softmodem feature, GOfax.IP does not emulate fax modem devices but replaces HylaFAX's `faxgetty` and `faxsend` processes to communicate directly with FreeSWITCH using FreeSWITCH's Event Socket interface. From 2b4d071fa6f6b61983e6cd1abc3b075f26c3d198 Mon Sep 17 00:00:00 2001 From: Julian Kornberger Date: Thu, 16 Aug 2018 02:01:24 +0200 Subject: [PATCH 2/2] Don't use syslog for CI testing logger.go:39: Unix syslog delivery error --- gofaxlib/logger/logger.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gofaxlib/logger/logger.go b/gofaxlib/logger/logger.go index 8f65eb0..580483c 100644 --- a/gofaxlib/logger/logger.go +++ b/gofaxlib/logger/logger.go @@ -20,6 +20,7 @@ package logger import ( "log" "log/syslog" + "os" ) const ( @@ -34,6 +35,13 @@ var ( func init() { var err error log.SetFlags(LOG_FLAGS) + + if os.Getenv("CI") != "" { + // Running in Circle CI + Logger = log.New(os.Stderr, "", LOG_FLAGS) + return + } + Logger, err = syslog.NewLogger(LOG_PRIORITY, LOG_FLAGS) if err != nil { log.Fatal(err)