シェフを使って簡単なgit repoデプロイメントを行うのは難しいです。シェルフでdeployリソースを使用してgit repoをデプロイできません
deploy "tomatina" do
repo "git://github.com/visionmedia/express.git"
deploy_to '/tmp/selvam'
action :deploy
end
私はファイルでノードそのエラーのシェフ・クライアントを実行するときに見つからない例外:
は、これは私のレシピです。私はエラーが何であるか分かりません。私はシェフ&ルビーに新しいです、そして、エラーを追跡するために調べ始めるべき場所を知らない。ここに私のログです:
Starting Chef Client, version 12.9.41
resolving cookbooks for run list: ["myapp"]
Synchronizing Cookbooks:
- application_nodejs (2.0.1)
- build-essential (6.0.0)
- nodejs (1.3.0)
- apt (3.0.0)
- myapp (0.1.0)
- compat_resource (12.10.6)
- application (4.1.4)
Installing Cookbook Gems:
Compiling Cookbooks...
[2016-06-15T12:22:37+00:00] WARN: Chef::Provider::AptRepository already exists! Cannot create deprecation class for LWRP provider apt_repository from cookbook apt
[2016-06-15T12:22:37+00:00] WARN: AptRepository already exists! Deprecation class overwrites Custom resource apt_repository from cookbook apt
Converging 1 resources
Recipe: myapp::default
* deploy[tomatina] action deploy
- create new directory /tmp/selvam/shared
- clone from git://github.com/visionmedia/express.git into /tmp/selvam/shared/cached-copy
- checkout ref 31dd549f350accd7b4e3685c13f745e857557827 branch HEAD
- force ownership of /tmp/selvam to :
- deploy from repo to /tmp/selvam/releases
- force ownership of /tmp/selvam to :
- evaluate block and run any associated actions
================================================================================
Error executing action `deploy` on resource 'deploy[tomatina]'
================================================================================
Chef::Exceptions::FileNotFound
------------------------------
Cannot symlink /tmp/selvam/shared/config/database.yml to /tmp/selvam/releases/20160615122237/config/database.yml before migrate: No such file or directory @ sys_fail2 - (/tmp/selvam/shared/config/database.yml, /tmp/selvam/releases/20160615122237/config/database.yml)
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:41:in `run_action'
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/myapp/recipes/default.rb
9: deploy "tomatina" do
10: repo 'git://github.com/visionmedia/express.git'
11: deploy_to '/tmp/selvam'
12: action :deploy
13: end
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/myapp/recipes/default.rb:9:in `from_file'
deploy("tomatina") do
action [:deploy]
updated true
updated_by_last_action true
retries 0
retry_delay 2
default_guard_interpreter :default
deploy_to "/tmp/selvam"
repository_cache "cached-copy"
purge_before_symlink ["log", "tmp/pids", "public/system"]
create_dirs_before_symlink ["tmp", "public", "config"]
symlink_before_migrate {"config/database.yml"=>"config/database.yml"}
symlinks {"system"=>"public/system", "pids"=>"tmp/pids", "log"=>"log"}
revision "HEAD"
remote "origin"
scm_provider Chef::Provider::Git
keep_releases 5
enable_checkout true
checkout_branch "deploy"
declared_type :deploy
cookbook_name "myapp"
recipe_name "default"
repo "git://github.com/visionmedia/express.git"
shared_path "/tmp/selvam/shared"
destination "/tmp/selvam/shared/cached-copy"
current_path "/tmp/selvam/current"
end
Platform:
---------
x86_64-linux
Running handlers:
[2016-06-15T12:23:04+00:00] ERROR: Running exception handlers
Running handlers complete
[2016-06-15T12:23:04+00:00] ERROR: Exception handlers complete
Chef Client failed. 1 resources updated in 28 seconds
[2016-06-15T12:23:04+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-06-15T12:23:04+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-06-15T12:23:04+00:00] ERROR: deploy[tomatina] (myapp::default line 9) had an error: Chef::Exceptions::FileNotFound: Cannot symlink /tmp/selvam/shared/config/database.yml to /tmp/selvam/releases/20160615122237/config/database.yml before migrate: No such file or directory @ sys_fail2 - (/tmp/selvam/shared/config/database.yml, /tmp/selvam/releases/20160615122237/config/database.yml)
[2016-06-15T12:23:04+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
私のワークステーション、chefserver &ノードは、Ubuntuの16.04を実行しています。
シェフの詳細:
シェフ開発キットバージョン:0.13.21
シェフ・クライアントバージョン:12.9.41
バークスバージョン:4.3.2
キッチンバージョン:1.7。 3
シェフ:12.9.41
ありがとうございました!ドキュメントを通過します。 – soupybionics