Add an aarch64 build

This commit is contained in:
Finn 2020-12-12 18:43:30 -08:00
parent b112886093
commit 3f15ef6ee7
4 changed files with 26 additions and 3 deletions

View file

@ -15,7 +15,7 @@ lint:
- diff --color=always go.mod "${CI_PROJECT_DIR}/go.mod" - diff --color=always go.mod "${CI_PROJECT_DIR}/go.mod"
- diff --color=always go.sum "${CI_PROJECT_DIR}/go.sum" - diff --color=always go.sum "${CI_PROJECT_DIR}/go.sum"
build: build:x86:
stage: build stage: build
image: golang:latest image: golang:latest
before_script: before_script:
@ -28,3 +28,18 @@ build:
paths: paths:
- signaldctl - signaldctl
expire_in: 1 month 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

View file

@ -42,8 +42,8 @@ var registerCmd = &cobra.Command{
} }
go s.Listen(nil) go s.Listen(nil)
r := <-s.GetResponseListener(requestID)
defer s.CloseResponseListener(requestID) defer s.CloseResponseListener(requestID)
r := <-s.GetResponseListener(requestID)
account, err := r.Data.MarshalJSON() account, err := r.Data.MarshalJSON()
if err != nil { if err != nil {
log.Fatal("error rendering response:", err) log.Fatal("error rendering response:", err)

View file

@ -47,8 +47,8 @@ var verify = &cobra.Command{
} }
go s.Listen(nil) go s.Listen(nil)
r := <-s.GetResponseListener(requestID)
defer s.CloseResponseListener(requestID) defer s.CloseResponseListener(requestID)
r := <-s.GetResponseListener(requestID)
account, err := r.Data.MarshalJSON() account, err := r.Data.MarshalJSON()
if err != nil { if err != nil {
log.Fatal("error rendering response:", err) log.Fatal("error rendering response:", err)

View file

@ -18,6 +18,7 @@ package signald
import ( import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"fmt"
"io" "io"
"log" "log"
"net" "net"
@ -142,3 +143,10 @@ func (s *Signald) readNext() (b BasicResponse, err error) {
} }
return return
} }
func (b BasicResponse) GetError() error {
if b.Error == nil {
return nil
}
return fmt.Errorf("signald error: %s", string(b.Error))
}