Ant数据库重建脚本,避免交互式提示
我正在编写一个 Ant 脚本来重建我们的数据库,即删除所有内容并从头开始重建。问题是我们的 DBA 在执行脚本的其余部分之前添加了 Y/N 提示,因此我们无法从自动构建过程中调用它。
有人有任何建议来规避 Y/N 提示吗?显然,我们可以创建单独的脚本,一个用于 DBA,一个用于自动构建 - 但这需要同时维护两者。我们在 Windows 上运行,因此不像使用 sed 来删除提示那么容易......但我正在考虑类似的事情。
不确定这是否足够清楚,但希望你能提供帮助。
干杯。
I'm writing an ant script to rebuild our database i.e. dropping everything and rebuilding from scratch. The problem our DBA adds a Y/N prompt before executing the rest of the script, and therefore we can't call this from an automated build process.
Does anyone have any suggestions to circumvent the Y/N prompt? Obviously we could create separate scripts, one for the DBA's and one for the automated build - but this requires maintaining both. We're running on Windows so it's not as easy as using sed to strip out the prompt...but I'm thinking something along those lines.
Not sure if that's clear enough but hope you can help.
Cheers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许 Expect 会有帮助?
http://en.wikipedia.org/wiki/Expect
Maybe Expect would help?
http://en.wikipedia.org/wiki/Expect
似乎 DBA 应该考虑更多的自动化,并使脚本不会弹出 gui yes no 对话框。他们让“是”、“否”成为命令行选项怎么样?我认为你可以克服困难来克服这个问题,但是将工作推向需要重新设计的流程部分。
看一下 AutoIT
这会让您找到对话框和“是”按钮,自动点击。但我仍然认为 DBA 应该远离 GUI 来处理这种“是”或“否”的输入。
Seems like the DBA should be thinking more automation and make the script not pop up a gui yes no dialog. How about they make the yes no a command line option. I think you can jump through hoops to get past this, but push the work on the part of the process that needs to be reworked.
Take a look at AutoIT
This will let you possibly find the dialog and the yes button and automate the clicking. But I still say the DBA should move away from the GUI for this yes no input.