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