这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@vincentfretin
Copy link
Contributor

I don't think it's a good idea to document the use of -o pipefail by default.
Plugin author blindly follow this instruction and we have issue with the plugin after that.
A simple command like:
elasticsearch:create)
# Check if Elasticsearch container is installed
IMAGE=$(docker images | grep "jezdez/elasticsearch" | awk '{print $3}')
if [[ -z $IMAGE ]]; then
echo "Elasticsearch image not found... Did you run 'dokku plugins-install' ?"
exit 1
fi

will completely stop dokku right before the if because grep returned exit code 1. (jezdez/elasticsearch image not build)

@josegonzalez
Copy link
Member

@michaelshobbs thoughts on this? I feel as though if a plugin fails, then the deploy should also fail, but I'm not strong on that opinion.

@michaelshobbs
Copy link
Member

Seeing as core is fairly religious about using pipefail I would think others should as well. The way around this example would || true. However, I think it ultimately up to the author of the plugin as to what makes sense in their use case. Augmenting the docs with pros/cons might be fine but I wouldn't remove the example altogether.

@josegonzalez
Copy link
Member

@vincentfretin do you mind updating the example and making it apparent as to what pipefail does?

@vincentfretin
Copy link
Contributor Author

@michaelshobbs
IMAGE=$(docker images | grep "jezdez/elasticsearch" | awk '{print $3}' || true) doesn't work. The script exists before the awk command.

@josegonzalez I updated the PR.

docs/plugins.md Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should still have a space :)

@vincentfretin
Copy link
Contributor Author

Oups, fixed

@michaelshobbs
Copy link
Member

Yeah @vincentfretin you would need to do that for every command that could fail. I'm not saying its the right choice for your plugin. Just an option.

josegonzalez added a commit that referenced this pull request Jan 20, 2015
Don't use -o pipefail for plugin
@josegonzalez josegonzalez merged commit 40d1f22 into dokku:master Jan 20, 2015
@vincentfretin vincentfretin deleted the patch-5 branch May 16, 2015 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants