screwdriver-api 8.0.202 → 8.0.204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/pipelines/update.js +10 -2
package/package.json
CHANGED
|
@@ -161,7 +161,15 @@ module.exports = () => ({
|
|
|
161
161
|
|
|
162
162
|
// Apply state change and return early
|
|
163
163
|
applyStateChange(oldPipeline, state, username, stateChangeMessage);
|
|
164
|
-
|
|
164
|
+
let updatedPipeline;
|
|
165
|
+
|
|
166
|
+
// Screwdriver admins may not have valid pipeline-admin SCM credentials,
|
|
167
|
+
// so persist the state change without accessing SCM.
|
|
168
|
+
if (isScrewdriverAdmin) {
|
|
169
|
+
updatedPipeline = await (state === 'ACTIVE' ? oldPipeline.enable() : oldPipeline.disable());
|
|
170
|
+
} else {
|
|
171
|
+
updatedPipeline = await oldPipeline.update();
|
|
172
|
+
}
|
|
165
173
|
|
|
166
174
|
return h.response(updatedPipeline.toJson()).code(200);
|
|
167
175
|
}
|
|
@@ -200,7 +208,7 @@ module.exports = () => ({
|
|
|
200
208
|
}
|
|
201
209
|
|
|
202
210
|
applyStateChange(oldPipeline, state, username, stateChangeMessage);
|
|
203
|
-
const updatedPipeline = await oldPipeline.
|
|
211
|
+
const updatedPipeline = await (state === 'ACTIVE' ? oldPipeline.enable() : oldPipeline.disable());
|
|
204
212
|
|
|
205
213
|
return h.response(updatedPipeline.toJson()).code(200);
|
|
206
214
|
}
|