I am trying to deploy a Django application using AWS OpsWorks. I'm brand spanking new to any sort of DevOps work, so I'm having considerable difficulties.
I am trying to use this cookbook to automate my deployments. I need Python3.4, so I modified a few things in the cookbook. Right now during the deploy hook, I am getting an error from the following code:
# install requirements
requirements = Helpers.django_setting(deploy, 'requirements', node)
if requirements
Chef::Log.info("Installing using requirements file: #{requirements}")
pip_cmd = ::File.join(deploy["venv"], 'bin', 'pip')
execute "#{pip_cmd} install --source=#{Dir.tmpdir} -r #{::File.join(deploy[:deploy_to], 'current', requirements)}" do
cwd ::File.join(deploy[:deploy_to], 'current')
user deploy[:user]
group deploy[:group]
environment 'HOME' => ::File.join(deploy[:deploy_to], 'shared')
end
else
Chef::Log.debug("No requirements file found")
end
The error reports:
STDERR: /opt/aws/opsworks/releases/20141216163306_33300020141216163306/vendor/bundle/ruby/2.0.0/gems/mixlib-shellout-1.4.0/lib/mixlib/shellout/unix.rb:147:in `chdir': No such file or directory - /srv/www/django/current (Errno::ENOENT)
I get that this code is trying to install requirements from my requirements.txt file, but what is up with the tmp directory and the current directory? Clearly there is no current directory created when I do my deployment. What is the file structure generally like for code being pulled into OpsWorks from a deploy? Moreover, how might I go about finding a fix for this error?
I've been reading through documentation on Chef, OpsWorks, KitchenCI, Berksfile, and other technologies for days just feeling swamped by everything in the world of DevOps. I just want to get my application running!
Aucun commentaire:
Enregistrer un commentaire