Skip to content

Commit fb41871

Browse files
authored
feat: adds ci config files path methods (#318)
This `PR` adds a couple of CI config file paths: - common.env path (shared defaults) - environment-specific .env path(s)
1 parent 51ef269 commit fb41871

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

.changeset/four-grapes-warn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chainlink-deployments-framework": patch
3+
---
4+
5+
feat: adds ci config files path methods

engine/cld/domain/domain.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,13 @@ func (d Domain) ConfigNetworksDirPath() string {
135135
func (d Domain) ConfigCIDirPath() string {
136136
return filepath.Join(d.ConfigDirPath(), DomainConfigCIDirName)
137137
}
138+
139+
// ConfigCICommonFilePath returns the path to the domain's CI common .env file.
140+
func (d Domain) ConfigCICommonFilePath() string {
141+
return filepath.Join(d.ConfigCIDirPath(), "common.env")
142+
}
143+
144+
// ConfigCIEnvFilePath returns the path to the domain's CI .env file for the specified environment.
145+
func (d Domain) ConfigCIEnvFilePath(env string) string {
146+
return filepath.Join(d.ConfigCIDirPath(), env+".env")
147+
}

engine/cld/domain/domain_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,18 @@ func Test_Domain_ConfigCIDirPath(t *testing.T) {
235235
assert.Equal(t, "domains/ccip/.config/ci", d.ConfigCIDirPath())
236236
}
237237

238+
func Test_Domain_ConfigCICommonFilePath(t *testing.T) {
239+
t.Parallel()
240+
d := NewDomain("domains", "ccip")
241+
assert.Equal(t, "domains/ccip/.config/ci/common.env", d.ConfigCICommonFilePath())
242+
}
243+
244+
func Test_Domain_ConfigCIEnvFilePath(t *testing.T) {
245+
t.Parallel()
246+
d := NewDomain("domains", "ccip")
247+
assert.Equal(t, "domains/ccip/.config/ci/staging.env", d.ConfigCIEnvFilePath("staging"))
248+
}
249+
238250
// todo: uncomment after moving migration registry over to cldf
239251
// func Test_EnvDir_LatestExecutedMigration(t *testing.T) {
240252
// t.Parallel()

0 commit comments

Comments
 (0)