diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5cc0503..3ea4fcd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ lint: - diff --color=always go.mod "${CI_PROJECT_DIR}/go.mod" - diff --color=always go.sum "${CI_PROJECT_DIR}/go.sum" -build: +build:x86: stage: build image: golang:latest before_script: @@ -28,3 +28,18 @@ build: paths: - signaldctl expire_in: 1 month + +build:aarch64: + stage: build + tag: [arm-builder] + image: golang:latest + before_script: + - mkdir -p /go/src/gitlab.com/signald/signald-go + - cp -r * /go/src/gitlab.com/signald/signald-go + - cd /go/src/gitlab.com/signald/signald-go + script: + - go build -o "${CI_PROJECT_DIR}/signaldctl" ./cmd/signaldctl + artifacts: + paths: + - signaldctl + expire_in: 1 month \ No newline at end of file diff --git a/cmd/signaldctl/cmd/register.go b/cmd/signaldctl/cmd/register.go index 77a5b67..26a41bd 100644 --- a/cmd/signaldctl/cmd/register.go +++ b/cmd/signaldctl/cmd/register.go @@ -42,8 +42,8 @@ var registerCmd = &cobra.Command{ } go s.Listen(nil) - r := <-s.GetResponseListener(requestID) defer s.CloseResponseListener(requestID) + r := <-s.GetResponseListener(requestID) account, err := r.Data.MarshalJSON() if err != nil { log.Fatal("error rendering response:", err) diff --git a/cmd/signaldctl/cmd/verify.go b/cmd/signaldctl/cmd/verify.go index 5bd5d3a..154f2d4 100644 --- a/cmd/signaldctl/cmd/verify.go +++ b/cmd/signaldctl/cmd/verify.go @@ -47,8 +47,8 @@ var verify = &cobra.Command{ } go s.Listen(nil) - r := <-s.GetResponseListener(requestID) defer s.CloseResponseListener(requestID) + r := <-s.GetResponseListener(requestID) account, err := r.Data.MarshalJSON() if err != nil { log.Fatal("error rendering response:", err) diff --git a/signald/signald.go b/signald/signald.go index f1200d8..74ba296 100644 --- a/signald/signald.go +++ b/signald/signald.go @@ -18,6 +18,7 @@ package signald import ( "bytes" "encoding/json" + "fmt" "io" "log" "net" @@ -142,3 +143,10 @@ func (s *Signald) readNext() (b BasicResponse, err error) { } return } + +func (b BasicResponse) GetError() error { + if b.Error == nil { + return nil + } + return fmt.Errorf("signald error: %s", string(b.Error)) +}