@@ -72,7 +72,28 @@ export async function triggerSelfHostedPreview(werft: Werft, config: JobConfig,
72
72
const replicatedChannel = config . replicatedChannel || config . repository . branch ;
73
73
const cluster = config . cluster || "k3s" ;
74
74
75
+ var licenseFlag : string = ""
76
+
77
+ if ( ! [ "stable" , "unstable" , "beta" ] . includes ( replicatedChannel . toLowerCase ( ) ) ) {
78
+ werft . phase ( "get-replicated-license" , `Create and download replicated license for ${ replicatedChannel } ` ) ;
79
+
80
+ exec ( `replicated customer create --channel ${ replicatedChannel } --name ${ replicatedChannel } ` ,
81
+ { slice : "get-replicated-license" } )
82
+
83
+ exec ( `replicated customer download-license --customer ${ replicatedChannel } > license.yaml` ,
84
+ { slice : "get-replicated-license" , dontCheckRc : true } )
85
+
86
+ exec ( `install -D license.yaml install/licenses/${ replicatedChannel } .yaml` ,
87
+ { slice : "get-replicated-license" } ,
88
+ )
89
+ werft . done ( "get-replicated-license" ) ;
90
+
91
+ licenseFlag = `-s install/licenses/${ replicatedChannel } .yaml`
92
+ }
93
+
94
+
75
95
exec ( `git config --global user.name "${ username } "` ) ;
96
+
76
97
var annotation = `-a channel=${ replicatedChannel } -a preview=true -a skipTests=true -a deps=external` ;
77
98
78
99
werft . phase ( "self-hosted-preview" , `Create self-hosted preview in ${ cluster } ` ) ;
@@ -83,7 +104,7 @@ export async function triggerSelfHostedPreview(werft: Werft, config: JobConfig,
83
104
84
105
try {
85
106
exec (
86
- `werft run --remote-job-path ${ testFile } ${ annotation } github` ,
107
+ `werft run --remote-job-path ${ testFile } ${ annotation } github ${ licenseFlag } ` ,
87
108
{
88
109
slice : "self-hosted-preview"
89
110
} ,
0 commit comments