Files
ziti/network-tests/simple-transfer/actions/bootstrap.go
T
Cam Otts 4b2d97d293 Simple transfer (#808)
* Merge branch 'action-test' of github.com:openziti/ziti into simple-transfer-test

* added metricbeat initialization

* updates to the simple network testing

* update zitilab and fablad deps and integrate env variables

* removed incorrect file

* move env up to top

* added run and test

* mod tidy

* mod got out of sync

* remove influx logging from ziti-probe due to being removed from metrics

* add ls to see why simple-transfer isnt built

* dig deeper

* need to copy not move

* back to release dir

* might need to sudo

* mke files executable

* bootsrap from correct directory

* add extra restart to confirm network spins up

* add retry for inrastructure

* build correct binaries

* add build ignore ot stages as well

* don't return error after successful retry

* fix err assign

* update zitilab version

* removed local testing paths

* update configs and env variables

* added env prepend

* remove build number for debugging

* add different formatting

* updated build/run number

* paren in incorrect place

* added specific version of metricbeat to install

* flip back correct ziti loc

* removed builds for mac & windows

* Removed test build for mac & windows

* remove ziti-probe

* flip ziti test to run alongside mac & windows builds

* remove unneeded needs

* remove for sanity check

* remove old uploads

* remove space

* setup ziti version properly

* remove zitilab testing to confirm running

* try removing all changes?

* remove even comments?

* I dont understand

* revert

* start from scratch. Small increments.

* simplify first job?

* try spearating build and publish

* run all 3 builds at the same time

* missed env variables

* update to run zitilab tests

* corrected dirs

* fixing ziti root

* redo build in publish step

* applied pr comments

* add in mkdir and remove buildint test binaries in publish step

* forgot to remove move

* update linux build requirement to 1.19
2022-10-04 14:16:49 -05:00

52 lines
2.1 KiB
Go

package actions
import (
"time"
"github.com/openziti/fablab/kernel/lib/actions"
"github.com/openziti/fablab/kernel/lib/actions/component"
"github.com/openziti/fablab/kernel/lib/actions/host"
"github.com/openziti/fablab/kernel/lib/actions/semaphore"
"github.com/openziti/fablab/kernel/model"
zitilib_actions "github.com/openziti/zitilab/actions"
"github.com/openziti/zitilab/actions/edge"
"github.com/openziti/zitilab/models"
)
type bootstrapAction struct{}
func NewBootstrapAction() model.ActionBinder {
action := &bootstrapAction{}
return action.bind
}
func (a *bootstrapAction) bind(m *model.Model) model.Action {
workflow := actions.Workflow()
workflow.AddAction(host.GroupExec("*", 25, "rm -f logs/*"))
workflow.AddAction(component.Stop("#ctrl"))
workflow.AddAction(edge.InitController("#ctrl"))
workflow.AddAction(component.Start("#ctrl"))
workflow.AddAction(semaphore.Sleep(2 * time.Second))
workflow.AddAction(edge.Login("#ctrl"))
workflow.AddAction(component.StopInParallel(models.EdgeRouterTag, 25))
workflow.AddAction(edge.InitEdgeRouters(models.EdgeRouterTag, 2))
workflow.AddAction(edge.InitIdentities(models.SdkAppTag, 2))
workflow.AddAction(zitilib_actions.Edge("create", "service", "echo"))
workflow.AddAction(zitilib_actions.Edge("create", "service-policy", "echo-servers", "Bind", "--service-roles", "@echo", "--identity-roles", "#service"))
workflow.AddAction(zitilib_actions.Edge("create", "service-policy", "echo-client", "Dial", "--service-roles", "@echo", "--identity-roles", "#client"))
workflow.AddAction(zitilib_actions.Edge("create", "edge-router-policy", "echo-servers", "--edge-router-roles", "@router-east", "--identity-roles", "#service"))
workflow.AddAction(zitilib_actions.Edge("create", "edge-router-policy", "echo-clients", "--edge-router-roles", "@router-west", "--identity-roles", "#client"))
workflow.AddAction(zitilib_actions.Edge("create", "service-edge-router-policy", "echo", "--semantic", "AnyOf", "--service-roles", "@echo", "--edge-router-roles", "#all"))
workflow.AddAction(component.Stop(models.ControllerTag))
return workflow
}