Code Monkey home page Code Monkey logo

poise-archive-cookbook's Introduction

Poise-Archive Cookbook

Build Status Gem Version Cookbook Version Coverage Gemnasium License

A Chef cookbook to unpack file archives.

It supports .tar, .tar.gz, .tar.bz2, and .zip archive files.

Quick Start

To download an unpack and archive:

poise_archive 'https://example.com/myapp.tgz' do
  destination '/opt/myapp'
end

Requirements

Chef 12.1 or newer is required.

Platforms

This cookbook supports all platforms (including Windows) but some Unix platforms (Solaris, AIX) may see very slow tar file unpacking when using the pure-Ruby fallback implementation.

Resources

poise_archive

The poise_archive resource unpacks file archives.

poise_archive '/tmp/myapp-1.2.0.tar' do
  destination '/srv/myapp-1.2.0'
end

A URL can also be passed as the source path, optionally with extra properties to be merged with source_properties.

poise_archive 'http://example.com/myapp-1.2.0.zip' do
  destination '/srv/myapp-1.2.0'
end

poise_archive ['http://example.com/myapp-1.2.0.zip', {headers: {'Authentication' => '...'}}] do
  destination '/srv/myapp-1.2.0'
end

Actions

  • :unpack – Unpack the archive. (default)

Properties

  • path – Path to the archive. If relative, it is taken as a file inside Chef::Config[:file_cache_path]. If a URL, it is downloaded to a cache file first. (name attribute)
  • destination – Path to unpack the archive to. If not specified, the path of the archive without the file extension is used. Required when unpacking from a URL. (default: auto)
  • group – Group to run the unpack as.
  • keep_existing – Keep existing files in the destination directory when unpacking. (default: false)
  • source_properties – Property key/value pairs to be applied to the remote_file file resource when downloading a URL. (default: {retries: 5})
  • strip_components – Number of intermediary directories to skip when unpacking. Works like GNU tar's --strip-components. (default: 1)
  • user – User to run the unpack as.

Sponsors

Development sponsored by Bloomberg.

The Poise test server infrastructure is sponsored by Rackspace.

License

Copyright 2016-2017, Noah Kantrowitz

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

BZip2 implementation is based on RBzip2. Copyright Sebastian Staudt, Brian Lopez. RBzip2 code used under the terms of the new BSD license.

poise-archive-cookbook's People

Contributors

alexey-rudenko avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.