@@ -51,6 +51,13 @@ const RUNTIME_IMAGES = {
51
51
PIPELINE_DEBUGGER_IMAGE : 'codefresh/cf-debugger:1.1.2' ,
52
52
} ;
53
53
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
+
54
61
const maxRuntimeNameLength = 63 ;
55
62
const DefaultLogFormatter = 'plain' ;
56
63
@@ -86,7 +93,7 @@ async function getTestPipelineLink(pipelineName, pipeline) {
86
93
return '' ;
87
94
}
88
95
89
- async function createTestPipeline ( runtimeName , pipelineName , pipelineCommands ) {
96
+ async function createTestPipeline ( runtimeName , pipelineName , pipelineCommands , dockerRegistry ) {
90
97
await _createRunnerProjectIfNotExists ( ) ;
91
98
console . log ( `Creating test pipeline with the name: "${ colors . cyan ( pipelineName ) } " ` +
92
99
`in project "${ colors . cyan ( INSTALLATION_DEFAULTS . PROJECT_NAME ) } "` ) ;
@@ -95,12 +102,15 @@ async function createTestPipeline(runtimeName, pipelineName, pipelineCommands) {
95
102
pipeline . spec . runtimeEnvironment = {
96
103
name : runtimeName ,
97
104
} ;
105
+
106
+ const demoStepImage = DEMO_STEP_IMAGE [ dockerRegistry ] || DEMO_STEP_IMAGE . default ;
107
+
98
108
pipeline . spec . steps = { } ;
99
109
pipeline . spec . stages = [ 'test' ] ;
100
110
pipeline . spec . steps . test = {
101
111
stage : 'test' ,
102
112
title : 'test' ,
103
- image : 'alpine:latest' ,
113
+ image : demoStepImage ,
104
114
commands : pipelineCommands || [ 'echo hello Codefresh Runner!' ] ,
105
115
} ;
106
116
@@ -130,11 +140,10 @@ async function getTestPipeline(pipelineName) {
130
140
return pipeline ;
131
141
}
132
142
133
-
134
143
return null ;
135
144
}
136
145
137
- async function updateTestPipelineRuntime ( pipeline , runtimeName , pipelineName ) {
146
+ async function updateTestPipelineRuntime ( pipeline , runtimeName , pipelineName , dockerRegistry ) {
138
147
let _pipeline = pipeline ;
139
148
if ( ! _pipeline ) {
140
149
const testPipeline = await getTestPipeline ( pipelineName ) ;
@@ -147,6 +156,10 @@ async function updateTestPipelineRuntime(pipeline, runtimeName, pipelineName) {
147
156
name : runtimeName ,
148
157
} ;
149
158
159
+ let demoStepImage = DEMO_STEP_IMAGE [ dockerRegistry ] || DEMO_STEP_IMAGE . default ;
160
+
161
+ _pipeline . spec . steps . test . image = demoStepImage ;
162
+
150
163
await sdk . pipelines . replace (
151
164
{ name : _pipeline . metadata . name } ,
152
165
{
0 commit comments