安装特定库版本

编程入门 行业动态 更新时间:2024-10-27 18:19:45
本文介绍了安装特定库版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用带有Maven和Tomcat食谱的vagrant-berkshelf,我可以指定要安装的主要版本。

Using vagrant-berkshelf with the Maven and Tomcat cookbooks, I can specify a major version to install.

示例:Maven-2或3个 Tomcat -5或6

Example: Maven - 2 or 3 Tomcat - 5 or 6

如果我想指定库的确切版本(Maven 3.2.1),是否应该使用Ark Cookbook安装所需的版本?

If I want to specify an exact version of a library (Maven 3.2.1), should I just use the Ark Cookbook to install the desired version?

DevOps经验有限,我习惯使用 yum 或 apt -get 来管理我的库,而无需指定特定版本。

Having limited DevOps experience, I'm used to making use of yum or apt-get to manage my libraries without specifying a particular version.

推荐答案

Maven食谱已经使用了方舟。因此,您可以覆盖以下节点属性:

The Maven cookbook already uses ark. So you could just override the following node attributes:

node['maven']['version'] = 3 node['maven']['3']['version'] = '3.2.1' node['maven']['3']['url'] = ??? node['maven']['3']['checksum'] = ???

tomcat食谱会安装软件包,因此您需要使用ark或构建一个Deb / RPM软件包。

The tomcat cookbook on the other hand does a package install, so you'd need to use ark or build a Deb/RPM package.

使用ark来安装tomcat的唯一缺点是您将没有服务脚本来管理tomcat的停止/启动/状态。

The only downside to using ark for tomcat is that you won't have service scripts to manage tomcat's stop/start/status. Some extra work would be needed.

以下是一个无所事事的项目,安装了Maven 3.2.1。

The following is a vagrant project that installs Maven 3.2.1

├── Berksfile └── Vagrantfile

Vagrantfile

Vagrantfile

Vagrant.require_plugin "vagrant-omnibus" Vagrant.require_plugin "vagrant-berkshelf" Vagrant.require_plugin "vagrant-chef-zero" VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Box config config.vm.box = "saucy64" config.vm.box_url = "cloud-images.ubuntu/vagrant/saucy/current/saucy-server-cloudimg-amd64-vagrant-disk1.box" # Virtualbox config config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--memory", 4096] end # Networking config config.vmwork "private_network", ip: "10.0.0.10" # Plugin config config.omnibus.chef_version = :latest config.chef_zero.enabled = true config.berkshelf.enabled = true # Chef config config.vm.provision :chef_client do |chef| chef.add_recipe "apt" chef.add_recipe "maven" chef.json = { 'maven' => { 'version' => 3, '3' => { 'version' => '3.2.1', 'url' => 'www.eu.apache/dist/maven/maven-3/3.2.1/binaries/apache-maven-3.2.1-bin.tar.gz', 'checksum' => 'cdee2fd50b2b4e34e2d67d01ab2018b051542ee759c07354dd7aed6f4f71675c' } } } end end

Berksfile

Berksfile

site :opscode cookbook 'apt' cookbook 'maven'

更多推荐

安装特定库版本

本文发布于:2023-10-24 17:34:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524576.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!