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

Options to provide custom chainlink and pg image in docker #11570

Merged
merged 2 commits into from
Dec 14, 2023
Merged
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
23 changes: 23 additions & 0 deletions integration-tests/docker/test_env/cl_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/smartcontractkit/chainlink-testing-framework/logging"
"github.com/smartcontractkit/chainlink-testing-framework/logstream"
"github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext"

"github.com/smartcontractkit/chainlink/v2/core/services/chainlink"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/chaintype"

Expand Down Expand Up @@ -83,6 +84,28 @@ func WithLogStream(ls *logstream.LogStream) ClNodeOption {
}
}

func WithImage(image string) ClNodeOption {
return func(c *ClNode) {
c.ContainerImage = image
}
}

func WithVersion(version string) ClNodeOption {
return func(c *ClNode) {
c.ContainerVersion = version
}
}

func WithPgDBOptions(opts ...test_env.PostgresDbOption) ClNodeOption {
return func(c *ClNode) {
var err error
c.PostgresDb, err = test_env.NewPostgresDb(c.EnvComponent.Networks, opts...)
if err != nil {
c.t.Fatalf("failed to create postgres db: %v", err)
}
}
}

func NewClNode(networks []string, imageName, imageVersion string, nodeConfig *chainlink.Config, opts ...ClNodeOption) (*ClNode, error) {
nodeDefaultCName := fmt.Sprintf("%s-%s", "cl-node", uuid.NewString()[0:8])
pgDefaultCName := fmt.Sprintf("pg-%s", nodeDefaultCName)
Expand Down
Loading