Skip to content

Commit

Permalink
Add customizable image repository to interslothtest
Browse files Browse the repository at this point in the history
  • Loading branch information
gjermundgaraba committed Jun 15, 2024
1 parent b72b197 commit 5cee49a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/interslothtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: slothchain
SLOTHCHAIN_IMAGE_REPOSITORY: ghcr.io/gjermundgaraba/slothchain
SLOTHCHAIN_IMAGE_VERSION: latest # TODO: It would be better to get a specific version of the image

jobs:
Expand Down
16 changes: 12 additions & 4 deletions interslothtest/utils/interchainvalues.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,21 @@ func (s *InterchainValues) SetupInterchainValues() {
}

func (s *InterchainValues) getChainFactory() *interchaintest.BuiltinChainFactory {
slothchainImageRepository := "slothchain"
slothchainImageVersion := "local"
env, found := os.LookupEnv("SLOTHCHAIN_IMAGE_VERSION")
envImageVersion, found := os.LookupEnv("SLOTHCHAIN_IMAGE_VERSION")
if found {
s.TT().Log("SLOTHCHAIN_IMAGE_VERSION from environment found", env)
slothchainImageVersion = env
s.TT().Log("SLOTHCHAIN_IMAGE_VERSION from environment found", envImageVersion)
slothchainImageVersion = envImageVersion
}
envImageRepository, found := os.LookupEnv("SLOTHCHAIN_IMAGE_REPOSITORY")
if found {
s.TT().Log("SLOTHCHAIN_IMAGE_REPOSITORY from environment found", envImageRepository)
slothchainImageRepository = envImageRepository
}

s.TT().Log("SLOTHCHAIN_IMAGE_VERSION", slothchainImageVersion)
s.TT().Log("SLOTHCHAIN_IMAGE_REPOSITORY", slothchainImageRepository)

return interchaintest.NewBuiltinChainFactory(zaptest.NewLogger(s.TT()), []*interchaintest.ChainSpec{
{
Expand All @@ -192,7 +200,7 @@ func (s *InterchainValues) getChainFactory() *interchaintest.BuiltinChainFactory
ChainID: slothChainId,
Images: []ibc.DockerImage{
{
Repository: "slothchain",
Repository: slothchainImageRepository,
Version: slothchainImageVersion,
UidGid: "1025:1025",
},
Expand Down

0 comments on commit 5cee49a

Please sign in to comment.