Comments (5)
The package will only be downloaded, if there is no nodejs installed or the version doesn't match the expected one.
not_if do
::File.exists?("/usr/local/bin/node") &&
system("/usr/local/bin/node -v | grep -q '#{node[:opsworks_nodejs][:version]}'")
end
and nodejs will only be installed, if a package was successfully downloaded
execute "Install node.js #{node[:opsworks_nodejs][:version]}" do
cwd "/tmp"
command "dpkg -i /tmp/#{node[:opsworks_nodejs][:deb]}"
only_if do
::File.exists?("/tmp/#{node[:opsworks_nodejs][:deb]}")
end
end
The nodejs package will be deleted after the recipe is through. We don't use the package resource here, because currently we host our packages as simple files on S3.
I don't really see the problem you are describing.
from opsworks-cookbooks.
@awsrequena Hey, thanks for the response. I'm using a slightly tweaked recipe, so it's possible I've done something to exclude it, but I don't see the nodejs package file being deleted after the recipe is through. Can you point me to the location in the recipes that takes care of that please?
BTW - dpkg has a -E option that lets you skip the install if it's the same version.
from opsworks-cookbooks.
Sorry, for the misleading information. The deletion of the package is not committed into master jet.
Thanks for the tipp, with the '-E'. The thing is that we don't want to download the agent unless it's necessary. Thus saving the download time.
from opsworks-cookbooks.
@awsrequena So with what's in master the installation is currently happening on each deploy right?
BTW - the package resource can also have an attribute called :source which can be used to specify a local file. i.e. /tmp/my-node-package.deb. The package resource is smart enough not to run the reinstall if the version already matches, although I haven't checked how it does this.
from opsworks-cookbooks.
You got me. Yes indeed, that code is installing the package every time ... that's why the deleting is on it's way.
I'll check if we can use that ":source" attribute.
Thanks again for the tipps.
from opsworks-cookbooks.
Related Issues (20)
- Amazon Linux 2016.09 and opsworks_nodejs HOT 1
- Unicorn master process not receiving QUIT HOT 3
- Ruby 2.4.0 HOT 30
- Node.js >=6.x cookbook setup HOT 1
- Can't download RPM package for nodejs on Amazon Linux 2016.09 HOT 1
- Berkshelf Pre-Built Packages Not Available (3.1.5) HOT 3
- Chef infrastructure issue. HOT 1
- [2017-08-11T13:48:48+00:00] FATAL: Stacktrace dumped to /var/lib/aws/opsworks/cache.stage2/chef-stacktrace.out HOT 1
- Wrong log format for ganglia
- Unable to download opsworks-agent-ruby on Ubuntu 16.04
- Ruby 2.5.0 HOT 8
- Getting Opsworks to use specific Ruby 2.4 version HOT 1
- Ruby 2.6.0 HOT 2
- Problem with S3 and region HOT 2
- ERROR: execute[apt-get update] (aws_opsworks_ecs::setup_ubuntu line 10) had an error: Mixlib::ShellOut::ShellCommandFailed
- Add Ruby 2.7 version
- --no-rdoc is not compatible with RubyGems 3+
- Please provide ruby 2.7 support
- Ruby 3.0 HOT 1
- bundle install error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opsworks-cookbooks.