some fixes for ci/notci
This commit is contained in:
@@ -2,10 +2,9 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
|
||||
"github.com/docker/docker/client"
|
||||
|
||||
"github.com/indra-labs/indra"
|
||||
|
||||
"github.com/indra-labs/indra/pkg/docker"
|
||||
"github.com/indra-labs/indra/pkg/proc/app"
|
||||
"github.com/indra-labs/indra/pkg/proc/cmds"
|
||||
@@ -13,7 +12,7 @@ import (
|
||||
"github.com/indra-labs/indra/pkg/proc/opts/config"
|
||||
"github.com/indra-labs/indra/pkg/proc/opts/meta"
|
||||
"github.com/indra-labs/indra/pkg/proc/opts/toggle"
|
||||
|
||||
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
@@ -54,66 +53,66 @@ var commands = &cmds.Command{
|
||||
}),
|
||||
},
|
||||
Entrypoint: func(command *cmds.Command, args []string) error {
|
||||
|
||||
|
||||
// If we've flagged stable, we should also build a stable tag
|
||||
if command.GetValue("stable").Bool() {
|
||||
docker.SetRelease()
|
||||
}
|
||||
|
||||
|
||||
// If we've flagged push, the tags will be pushed to all repositories.
|
||||
if command.GetValue("push").Bool() {
|
||||
docker.SetPush()
|
||||
}
|
||||
|
||||
|
||||
// Set a Timeout for 120 seconds
|
||||
ctx, cancel := context.WithTimeout(context.Background(), defaultBuildingTimeout)
|
||||
defer cancel()
|
||||
|
||||
|
||||
// Setup a new instance of the docker client
|
||||
|
||||
|
||||
var err error
|
||||
var cli *client.Client
|
||||
|
||||
|
||||
if cli, err = client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation()); check(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
defer cli.Close()
|
||||
|
||||
|
||||
// Get ready to submit the builds
|
||||
var builder = docker.NewBuilder(ctx, cli, sourceConfigurations, buildConfigurations, packagingConfigurations)
|
||||
|
||||
|
||||
if err = builder.Build(); check(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
if err = builder.Push(); check(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
if err = builder.Close(); check(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
|
||||
var err error
|
||||
var application *app.App
|
||||
|
||||
|
||||
// Creates a new application
|
||||
if application, err = app.New(commands, os.Args); check(err) {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
// Launches the application
|
||||
if err = application.Launch(); check(err) {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,10 @@ package dispatcher
|
||||
|
||||
import (
|
||||
"context"
|
||||
"math/big"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/VividCortex/ewma"
|
||||
"github.com/gookit/color"
|
||||
"github.com/indra-labs/indra/pkg/crypto"
|
||||
@@ -17,9 +21,6 @@ import (
|
||||
"github.com/indra-labs/indra/pkg/util/splice"
|
||||
"github.com/libp2p/go-libp2p/p2p/protocol/ping"
|
||||
"go.uber.org/atomic"
|
||||
"math/big"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -641,7 +642,7 @@ func NewDispatcher(l *transport.Conn, ctx context.Context,
|
||||
d.rekeying.Store(false)
|
||||
d.ip = blue(d.Conn.RemoteMultiaddr())
|
||||
var e error
|
||||
prk := d.Conn.LocalPrivateKey()
|
||||
prk := d.Conn.RemotePublicKey()
|
||||
var rprk slice.Bytes
|
||||
if rprk, e = prk.Raw(); fails(e) {
|
||||
return
|
||||
|
||||
@@ -2,14 +2,15 @@ package dispatcher
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/indra-labs/indra"
|
||||
"github.com/indra-labs/indra/pkg/engine"
|
||||
"github.com/indra-labs/indra/pkg/onions/confirmation"
|
||||
"github.com/indra-labs/indra/pkg/onions/ont"
|
||||
"github.com/indra-labs/indra/pkg/onions/response"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/indra-labs/indra/pkg/util/slice"
|
||||
"github.com/indra-labs/indra/pkg/util/splice"
|
||||
@@ -23,6 +24,7 @@ import (
|
||||
)
|
||||
|
||||
func TestDispatcher(t *testing.T) {
|
||||
t.Log(indra.CI)
|
||||
if indra.CI=="false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
log.D.Ln("debug")
|
||||
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
"github.com/indra-labs/indra/pkg/ad"
|
||||
"github.com/indra-labs/indra/pkg/onions/adaddress"
|
||||
"github.com/indra-labs/indra/pkg/onions/adintro"
|
||||
@@ -13,17 +15,18 @@ import (
|
||||
"github.com/indra-labs/indra/pkg/onions/reg"
|
||||
"github.com/indra-labs/indra/pkg/util/splice"
|
||||
pubsub "github.com/libp2p/go-libp2p-pubsub"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
func (ng *Engine) SendAd(a ad.Ad) (e error) {
|
||||
return ng.topic.Publish(ng.ctx, ont.Encode(a).GetAll())
|
||||
}
|
||||
|
||||
func (ng *Engine) RunAdHandler(handler func(p *pubsub.Message, ctx context.Context) (e error)) {
|
||||
// Since the frequency of updates should be around 1 hour we run here only one
|
||||
// thread here. Relays indicate their loading as part of the response message
|
||||
// protocol for ranking in the session cache.
|
||||
func (ng *Engine) RunAdHandler(handler func(p *pubsub.Message,
|
||||
ctx context.Context) (e error)) {
|
||||
|
||||
// Since the frequency of updates should be around 1 hour we run here only
|
||||
// one thread here. Relays indicate their loading as part of the response
|
||||
// message protocol for ranking in the session cache.
|
||||
go func(ng *Engine) {
|
||||
out:
|
||||
for {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package adpeer
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/indra-labs/indra"
|
||||
"github.com/indra-labs/indra/pkg/crypto"
|
||||
"github.com/indra-labs/indra/pkg/crypto/nonce"
|
||||
@@ -9,13 +10,11 @@ import (
|
||||
"github.com/indra-labs/indra/pkg/onions/reg"
|
||||
log2 "github.com/indra-labs/indra/pkg/proc/log"
|
||||
"github.com/indra-labs/indra/pkg/util/splice"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPeerAd(t *testing.T) {
|
||||
if indra.CI != "false" {
|
||||
log2.SetLogLevel(log2.Trace)
|
||||
fmt.Println("logging")
|
||||
}
|
||||
var e error
|
||||
pr, ks, _ := crypto.NewSigner()
|
||||
|
||||
@@ -34,7 +34,7 @@ const (
|
||||
Patch = 14
|
||||
)
|
||||
|
||||
var CI = "false"
|
||||
var CI = "true"
|
||||
|
||||
// Version returns a pretty printed version information string.
|
||||
func Version() string {
|
||||
|
||||
Reference in New Issue
Block a user