Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swanny/fix naming #7

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions consensusClient/lighthouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func NewLighthouseComponent(ctx *pulumi.Context, name string, args *ConsensusCli

// copy start script
startScript, err := remote.NewCopyFile(ctx, fmt.Sprintf("copyStartScript-%s", args.Client), &remote.CopyFileArgs{
LocalPath: pulumi.Sprintf("scripts/start_%s.sh", args.Client),
RemotePath: pulumi.Sprintf("/data/scripts/start_%s.sh", args.Client),
LocalPath: pulumi.Sprintf("scripts/start_%s_%s.sh", args.Client, args.Network),
RemotePath: pulumi.Sprintf("/data/scripts/start_%s_%s.sh", args.Client, args.Network),
Connection: args.Connection,
}, pulumi.Parent(component))
if err != nil {
Expand All @@ -103,7 +103,7 @@ func NewLighthouseComponent(ctx *pulumi.Context, name string, args *ConsensusCli

// script permissions
scriptPerms, err := remote.NewCommand(ctx, fmt.Sprintf("scriptPermissions-%s", args.Client), &remote.CommandArgs{
Create: pulumi.Sprintf("chmod +x /data/scripts/start_%s.sh", args.Client),
Create: pulumi.Sprintf("chmod +x /data/scripts/start_%s_%s.sh", args.Client, args.Network),
Connection: args.Connection,
}, pulumi.Parent(component), pulumi.DependsOn([]pulumi.Resource{startScript}))
if err != nil {
Expand All @@ -123,7 +123,7 @@ func NewLighthouseComponent(ctx *pulumi.Context, name string, args *ConsensusCli

// group permissions
_, err = remote.NewCommand(ctx, fmt.Sprintf("setDataDirGroupPermissions-%s", args.Client), &remote.CommandArgs{
Create: pulumi.Sprintf("chown -R %s:%s %s && chown %s:%s /data/bin/%s && chown %s:%s /data/scripts/start_%s.sh", args.Client, args.Client, args.DataDir, args.Client, args.Client, args.Client, args.Client, args.Client, args.Client),
Create: pulumi.Sprintf("chown -R %s:%s %s && chown %s:%s /data/bin/%s && chown %s:%s /data/scripts/start_%s_%s.sh", args.Client, args.Client, args.DataDir, args.Client, args.Client, args.Client, args.Client, args.Client, args.Client, args.Network),
Connection: args.Connection,
}, pulumi.Parent(component), pulumi.DependsOn([]pulumi.Resource{serviceDefinition, scriptPerms, startScript}))
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion executionClient/executionClient.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package executionClient

import (
"fmt"

"github.com/pulumi/pulumi-command/sdk/go/command/remote"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
Expand Down Expand Up @@ -52,7 +54,7 @@ func NewExecutionClientComponent(ctx *pulumi.Context, name string, args *Executi
}

component := &ExecutionClientComponent{}
err := ctx.RegisterComponentResource("custom:component:ExecutionClient", name, component, opts...)
err := ctx.RegisterComponentResource(fmt.Sprintf("custom:component:ExecutionClient:%s:%s", args.Client, args.Network), name, component, opts...)
if err != nil {
return nil, err
}
Expand Down
10 changes: 5 additions & 5 deletions executionClient/reth.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func NewRethComponent(ctx *pulumi.Context, name string, args *ExecutionClientCom

// copy start script
startScript, err := remote.NewCopyFile(ctx, fmt.Sprintf("copyStartScript-%s", args.Network), &remote.CopyFileArgs{
LocalPath: pulumi.Sprintf("scripts/start_%s.sh", args.Client),
RemotePath: pulumi.Sprintf("/data/scripts/start_%s.sh", args.Client),
LocalPath: pulumi.Sprintf("scripts/start_%s_%s.sh", args.Client, args.Network),
RemotePath: pulumi.Sprintf("/data/scripts/start_%s_%s.sh", args.Client, args.Network),
Connection: args.Connection,
}, pulumi.Parent(component))
if err != nil {
Expand All @@ -63,7 +63,7 @@ func NewRethComponent(ctx *pulumi.Context, name string, args *ExecutionClientCom

// script permissions
_, err = remote.NewCommand(ctx, fmt.Sprintf("scriptPermissions-%s", args.Network), &remote.CommandArgs{
Create: pulumi.Sprintf("chmod +x /data/scripts/start_%s.sh", args.Client),
Create: pulumi.Sprintf("chmod +x /data/scripts/start_%s_%s.sh", args.Client, args.Network),
Delete: pulumi.Sprintf("echo 0", args.Client),
Connection: args.Connection,
}, pulumi.Parent(component), pulumi.DependsOn([]pulumi.Resource{startScript}))
Expand All @@ -74,7 +74,7 @@ func NewRethComponent(ctx *pulumi.Context, name string, args *ExecutionClientCom

// Execute a sequence of commands on the remote serve`r
repo, err := remote.NewCommand(ctx, fmt.Sprintf("cloneRepo-%s", args.Network), &remote.CommandArgs{
Create: pulumi.Sprintf("git clone -b %s %s /data/repos/reth", cfg.Require("rethGitBranch"), cfg.Require("rethRepoURL")),
Create: pulumi.Sprintf("git clone -b %s %s /data/repos/%s/reth", cfg.Require("rethGitBranch"), cfg.Require("rethRepoURL"), args.Network),
Update: pulumi.String("cd /data/repos/reth && git pull"),
Connection: args.Connection,
}, pulumi.Parent(component), pulumi.ReplaceOnChanges([]string{"*"}))
Expand Down Expand Up @@ -126,7 +126,7 @@ func NewRethComponent(ctx *pulumi.Context, name string, args *ExecutionClientCom

// group permissions
groupPerms, err := remote.NewCommand(ctx, fmt.Sprintf("setDataDirGroupPermissions-%s", args.Network), &remote.CommandArgs{
Create: pulumi.Sprintf("chown -R %s:%s %s && chown %s:%s /data/bin/%s && chown %s:%s /data/scripts/start_%s.sh", args.Client, args.Client, args.DataDir, args.Client, args.Client, args.Client, args.Client, args.Client, args.Client),
Create: pulumi.Sprintf("chown -R %s:%s %s && chown %s:%s /data/bin/%s && chown %s:%s /data/scripts/start_%s_%s.sh", args.Client, args.Client, args.DataDir, args.Client, args.Client, args.Client, args.Client, args.Client, args.Client, args.Network),
Connection: args.Connection,
}, pulumi.Parent(component), pulumi.DependsOn([]pulumi.Resource{repo, startScript, rethInstallation}))
if err != nil {
Expand Down
Loading