0
我有我的應用程序目前通過的TeamCity和搖籃的混合部署在AWS Opsworks但我需要利用部署掛鉤來執行一些任務,如Liquibase遷移,符號鏈接等Opsworks的Java部署魚鉤
看樣子我有Opsworks認識到正確的RB文件存在於部署文件夾中,但是當它運行它們時,我會看到缺少屬性的隱式類型轉換錯誤。我試圖手動將這些添加到自定義JSON作爲解決方法無濟於事。
下面是錯誤,部署JSON和param,這似乎是導致問題。我只是想知道如何填寫屬性值並越過錯誤。提前致謝。
TypeError
---------
no implicit conversion of nil into String
Cookbook Trace:
---------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/deploy/definitions/opsworks_deploy.rb:154:in `block (3 levels) in from_file'
Resource Declaration:
---------------------
# In /var/lib/aws/opsworks/cache.stage2/cookbooks/deploy/definitions/opsworks_deploy.rb
65: deploy deploy[:deploy_to] do
66: provider Chef::Provider::Deploy.const_get(deploy[:chef_provider])
67: keep_releases deploy[:keep_releases]
68: repository deploy[:scm][:repository]
69: user deploy[:user]
70: group deploy[:group]
71: revision deploy[:scm][:revision]
72: migrate deploy[:migrate]
73: migration_command deploy[:migrate_command]
74: environment deploy[:environment].to_hash
75: create_dirs_before_symlink(deploy[:create_dirs_before_symlink])
76: symlink_before_migrate(deploy[:symlink_before_migrate])
77: action deploy[:action]
78:
79: if deploy[:application_type] == 'rails' && node[:opsworks][:instance][:layers].include?('rails-app')
80: restart_command "sleep #{deploy[:sleep_before_restart]} && #{node[:opsworks][:rails_stack][:restart_command]}"
81: end
82:
The attribute which seems to be generating the issue:
params {:deploy_data=>{"deploy_to"=>"/srv/www/deploy-name", (tons of skipped params) ..., :name=>nil}
Current JSON under which the error is thrown:
{"deploy": {"deploy-name": {"scm": {"user": "accesskey", "password": "secretkey" }}}}
Adjusted JSON in an attempt to resolve:
{"deploy": {"deploy-name": {"scm": {"user": "accesskey", "password": "secretkey" }}, "name": "deploy-name"}}