-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement workaround for incompatible change in cloud foundry API #343
Conversation
} | ||
application['buildpack'] = buildpacks[0] | ||
} | ||
application.remove('buildpacks') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if buildpacks is not a List?
vars/cloudFoundryDeploy.groovy
Outdated
def handleLegacyCfManifest(config) { | ||
def manifest = readYaml file: config.cloudFoundry.manifest | ||
manifest = CfManifestUtils.transform(manifest) | ||
sh "rm ${config.cloudFoundry.manifest}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could skip writing the file, in case nothing has changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, we prefer to keep it simple, and hence don't check for a change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my point of view okay if we add some more info for the users.
cloudFoundryDeploy( | ||
script: script, | ||
deployType: 'blue-green', | ||
cloudFoundry: target, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might describe how target
should look like ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
vars/cloudFoundryDeploy.groovy
Outdated
def manifest = readYaml file: config.cloudFoundry.manifest | ||
manifest = CfManifestUtils.transform(manifest) | ||
sh "rm ${config.cloudFoundry.manifest}" | ||
writeYaml file: config.cloudFoundry.manifest, data: manifest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add some information to the log that the manifest file has been re-written, maybe even with some references to cf documentation etc. to provide some background.
Without this we would silently do something which might be a problem for the users, especially in error situations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was to make it transparent in a way that the user does not have to know/care, and thus avoid noise. The whole thing is a bit complex to explain in one println
, but a reference can be added, I agree.
vars/cloudFoundryDeploy.groovy
Outdated
sh "echo $originalManifest" //todo | ||
sh "echo $transformedManifest" //todo | ||
if (originalManifest != transformedManifest) { | ||
echo "The file ${config.cloudFoundry.manifest} is not compatible with the Cloud Foundry blue-green deployment plugin. Re-writing inline." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use a multiline string and one echo command
Thanks for your review @OliverNocon, I addressed all comments. |
@@ -61,6 +61,10 @@ Deployment can be done | |||
- cfOrg | |||
- cfSpace | |||
|
|||
!!! note | |||
Due to [an incompatible change](https://github.com/cloudfoundry/cli/issues/1445) in the Cloud Foundry CLI, multiple buildpacks are not supported by this step. | |||
If your `application` contains a list of `buildpacks` instead a single `buildpack`, this will be automatically re-written by the step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only in case you are using the blue green deployment
changes:
Handle the case when cloud foundry manifest follows the new format (list of buildpacks) and transform to a single buildpack, since the blue-green plugin can't handle the new API.