@@ -51,6 +51,13 @@ const RUNTIME_IMAGES = {
5151 PIPELINE_DEBUGGER_IMAGE : 'codefresh/cf-debugger:1.1.2' ,
5252} ;
5353
54+ const DEMO_STEP_IMAGE = {
55+ 'docker.io' : 'alpine:latest' ,
56+ 'quay.io' : 'quay.io/codefresh/alpine:3.11' ,
57+ 'gcr.io' : 'gcr.io/google-containers/alpine-with-bash' ,
58+ default : 'quay.io/codefresh/alpine:3.11'
59+ }
60+
5461const maxRuntimeNameLength = 63 ;
5562const DefaultLogFormatter = 'plain' ;
5663
@@ -86,7 +93,7 @@ async function getTestPipelineLink(pipelineName, pipeline) {
8693 return '' ;
8794}
8895
89- async function createTestPipeline ( runtimeName , pipelineName , pipelineCommands ) {
96+ async function createTestPipeline ( runtimeName , pipelineName , pipelineCommands , dockerRegistry ) {
9097 await _createRunnerProjectIfNotExists ( ) ;
9198 console . log ( `Creating test pipeline with the name: "${ colors . cyan ( pipelineName ) } " ` +
9299 `in project "${ colors . cyan ( INSTALLATION_DEFAULTS . PROJECT_NAME ) } "` ) ;
@@ -95,12 +102,15 @@ async function createTestPipeline(runtimeName, pipelineName, pipelineCommands) {
95102 pipeline . spec . runtimeEnvironment = {
96103 name : runtimeName ,
97104 } ;
105+
106+ const demoStepImage = DEMO_STEP_IMAGE [ dockerRegistry ] || DEMO_STEP_IMAGE . default ;
107+
98108 pipeline . spec . steps = { } ;
99109 pipeline . spec . stages = [ 'test' ] ;
100110 pipeline . spec . steps . test = {
101111 stage : 'test' ,
102112 title : 'test' ,
103- image : 'alpine:latest' ,
113+ image : demoStepImage ,
104114 commands : pipelineCommands || [ 'echo hello Codefresh Runner!' ] ,
105115 } ;
106116
@@ -130,11 +140,10 @@ async function getTestPipeline(pipelineName) {
130140 return pipeline ;
131141 }
132142
133-
134143 return null ;
135144}
136145
137- async function updateTestPipelineRuntime ( pipeline , runtimeName , pipelineName ) {
146+ async function updateTestPipelineRuntime ( pipeline , runtimeName , pipelineName , dockerRegistry ) {
138147 let _pipeline = pipeline ;
139148 if ( ! _pipeline ) {
140149 const testPipeline = await getTestPipeline ( pipelineName ) ;
@@ -147,6 +156,10 @@ async function updateTestPipelineRuntime(pipeline, runtimeName, pipelineName) {
147156 name : runtimeName ,
148157 } ;
149158
159+ let demoStepImage = DEMO_STEP_IMAGE [ dockerRegistry ] || DEMO_STEP_IMAGE . default ;
160+
161+ _pipeline . spec . steps . test . image = demoStepImage ;
162+
150163 await sdk . pipelines . replace (
151164 { name : _pipeline . metadata . name } ,
152165 {
0 commit comments