Chef-Server:自动部署文件

时间:2014-01-27 17:44:40

标签: java tomcat chef chef-recipe cookbook

我需要一个简单的方法:从bitbucket下载存储库并将.war文件复制到'... / tomcat7 / webapps' 我试过了this。我很难知道我在说什么,但每次我都运行这个食谱:

application 'teste' do
  path         '/var/lib/tomcat7/webapps/teste'
  owner        node['tomcat']['user']
  group        node['tomcat']['group']
  repository   'https://bitbucket.org/willsoares/teste/src'
  revision     '2433cb2'
    scm_provider Chef::Provider::RemoteFile::Deploy

  java_webapp do
    context_template 'jenkins-context.xml.erb'
   end

  tomcat
end

我没有一个错误。一切都好,但这不“下载”文件。

此配方自动创建3个目录。当前,共享和发布,但不起作用,即使我将.war文件放入“当前”运行的输出:

    Starting Chef Client, version 11.8.2
Compiling Cookbooks...
Converging 3 resources
Recipe: application_java::default
  * application_java_java_webapp[EdwardApp] action nothing (skipped due to action :nothing)
  * application_java_tomcat[EdwardApp] action nothing (skipped due to action :nothing)
  * application[EdwardApp] action deploy  * application_java_java_webapp[EdwardApp] action before_compile (up to date)
  * application_java_tomcat[EdwardApp] action before_compile[2014-01-27T16:08:15-02:00] WARN: Using java::default instead is recommended.
 (up to date)
 (up to date)
Recipe: java::openjdk
  * package[openjdk-7-jdk] action install (up to date)
  * package[openjdk-7-jre-headless] action install (up to date)
  * java_alternatives[set-java-alternatives] action set (up to date)
Recipe: java::set_java_home
  * ruby_block[set-env-java-home] action run
    - execute the ruby block set-env-java-home

  * directory[/etc/profile.d] action create (up to date)
  * file[/etc/profile.d/jdk.sh] action create (up to date)
Recipe: tomcat::default
  * package[tomcat7] action install (up to date)
  * package[tomcat7-admin] action install (up to date)
  * directory[/usr/share/tomcat7/lib/endorsed] action create (up to date)
  * service[tomcat] action enable
    - enable service service[tomcat]

  * service[tomcat] action start (up to date)
  * template[/etc/default/tomcat7] action create (up to date)
  * template[/etc/tomcat7/server.xml] action create
    - update content in file /etc/tomcat7/server.xml from af0c79 to 4badd6
        --- /etc/tomcat7/server.xml 2014-01-27 16:06:08.473328323 -0200
        +++ /tmp/chef-rendered-template20140127-22727-q4j93k    2014-01-27 16:08:18.492672575 -0200
        @@ -89,9 +89,9 @@
             <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
                        proxyPort=""
                        keystoreFile="/etc/tomcat7/keystore.jks"
        -               keystorePass="vXy8xF0YuN6n9kgYvFXM"
        +               keystorePass="6o3WIP3PbICA3dEOx3ze"
                        keystoreType="jks"
        -               truststorePass="vXy8xF0YuN6n9kgYvFXM"
        +               truststorePass="6o3WIP3PbICA3dEOx3ze"
                        maxThreads="150" scheme="https" secure="true"
                        clientAuth="false" sslProtocol="TLS" />


  * template[/etc/tomcat7/logging.properties] action create (up to date)
  * execute[Create Tomcat SSL certificate] action run (up to date)
Recipe: <Dynamically Defined Resource>
  * directory[/var/lib/tomcat7/webapps/teste] action create (up to date)
  * directory[/var/lib/tomcat7/webapps/teste/shared] action create (up to date)
  * ruby_block[EdwardApp before_deploy] action runRecipe: application_java::default
  * application_java_java_webapp[EdwardApp] action before_deploy (up to date)
  * application_java_tomcat[EdwardApp] action before_deploy (up to date)

    - execute the ruby block EdwardApp before_deploy

Recipe: <Dynamically Defined Resource>
  * directory[/var/lib/tomcat7/webapps/teste/shared/log] action create (up to date)
  * directory[/var/lib/tomcat7/webapps/teste/shared/pids] action create (up to date)
  * directory[/var/lib/tomcat7/webapps/teste/shared/system] action create (up to date)
  * template[/var/lib/tomcat7/webapps/teste/shared/EdwardApp.xml] action create (up to date)
  * directory[/var/lib/tomcat7/webapps/ROOT] action delete
    - delete existing directory /var/lib/tomcat7/webapps/ROOT

  * link[/etc/tomcat7/Catalina/localhost/EdwardApp.xml] action create (up to date)
  * deploy_revision[EdwardApp] action deploy
    - purge old downloads (up to date)
Recipe: tomcat::default
  * service[tomcat] action restart
    - restart service service[tomcat]

0 个答案:

没有答案