我正在使用chef来编写一个安装mysql连接器的配方,将其解压缩并将.jar移动到/ lib文件夹。
bash "install_mysql-connector" do
user "root"
cwd "/opt/tomcat/lib/"
code <<-EOH
wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.29.tar.gz
tar -zxvf mysql-connector-java-5.1.29.tar.gz
EOH
end
bash "setting_mysql-connector" do
user "root"
cwd "/opt/tomcat/lib/mysql-connector-java-5.1.29"
code <<-EOH
mv mysql-connector-java-5.1.29-bin.jar /opt/tomcat/lib/
rm -rf mysql-connector-java-5.1.29.tar.gz
EOH
end
有没有办法将这两者结合起来,以便它们在同一个bash下运行?
我还尝试使用
从tar.gz文件中提取jql mysql-connector-java-5.1.29-bin.jartar -zxvf mysql-connector-java-5.1.29.tar.gz -C /opt/tomcat/lib mysql-connector-java-5.1.29-bin.jar
这是否缺少了什么?
答案 0 :(得分:0)
这个怎么样?从.tar.gz中提取jar文件并直接保存在/ opt / tomcat / lib下?
tar -zxvf mysql-connector-java-5.1.29.tar.gz mysql-connector-java-5.1.29-bin.jar -O > /opt/tomcat/lib/mysql-connector-java-5.1.29-bin.jar