Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

syncwrap

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syncwrap

  • 2.10.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= SyncWrap

  • http://github.com/dekellum/syncwrap
  • http://rdoc.gravitext.com/syncwrap/
  • {}[https://travis-ci.org/dekellum/syncwrap]

== Description

A rather direct provisioning and deployment system in ruby, bash over ssh, and rsync. SyncWrap is a refreshingly straightforward, DSL-free non-framework with no central server or repository requirements. The "magic", if any, lies in the elegant component model, the shell command queue, and a few powerful methods like rput (augmented rsync).

== Features

  • Default Thread-per-host parallel operation, with synchronized block/live console output for debugging.

  • Multi-line shell support (often via here-document), command queue, and composition support in SyncWrap::Component#sh for more natural script embedding. You'll know you are provisioning with bash, in all its syntactic glory.

  • SyncWrap::Component#rput wraps rsync, with support for multiple source roots, transparent ERB templates, and target file owner/permissions control. Returns the file change status allowing reactive scripting (i.e. restart daemon since config has changed.)

  • Linux distro differences are factored out into distro-specific components with utility methods exposed in host context.

  • SyncWrap::AmazonEC2 provider with host profiles: create and provision hosts in a single step.

  • Independent of (but easily integrated into) rake

  • Depends only on ruby 1.9+ stdlib Open3 for interaction with bash, ssh and rsync. Also works on jruby 1.7.x, 9.x and recent rubinuous (see Travis CI variants).

== Synopsis

Simplest example. Place the following in a sync.rb file:

class Greeter < SyncWrap::Component def install say_it end

def say_it
  sh <<-SH
    echo "Hello from #{host.name}"
  SH
end

end

host 'localhost', Greeter.new

Try it via the command line:

gem install syncwrap syncwrap --help syncwrap -f ./sync.rb --list # -f default; list syncwrap # Run it syncwrap -v # Run it with full verbose output syncwrap -v Greeter.say_it # Without Greeter#install default

Output from syncwrap -v (minus the terminal color):

== localhost #Module:0x00000001e95678::Greeter#install: enqueue <-- sh localhost (-v coalesce live) echo "Hello from localhost" Hello from localhost --> Exit 0 (success)

See more elaborate examples, including ec2 provider support, in the examples directory and LAYOUT.

== Components

Component hierarchy implementing SyncWrap::Distro, for common methods like dist_install and other distribution-specific behaviors:

  • SyncWrap::Debian
    • SyncWrap::Ubuntu
  • SyncWrap::RHEL
    • SyncWrap::CentOS
    • SyncWrap::AmazonLinux
  • SyncWrap::Arch (limited)

Non-exhaustive list of components implementing #install:

  • SyncWrap::MDRaid, SyncWrap::LVMCache — software raid, lvm volumes, lvm cache, filesystems, mounts

  • SyncWrap::Network and SyncWrap::EtcHosts — hostname, static names, resolver config

  • SyncWrap::Users — developer accounts, home directory files (incl. ssh keys), sudoers access

  • SyncWrap::RunUser — a user for running deployed daemons, jobs, in var directories.

  • SyncWrap::PostgreSQL

  • SyncWrap::OpenJDK or SyncWrap::CommercialJDK

  • SyncWrap::JRubyVM and/or SyncWrap::CRubyVM (MRI, from source)

  • SyncWrap::BundlerGem, SyncWrap::RakeGem, SyncWrap::TarpitGem — base (pre-bundle) rubygems

  • SyncWrap::SourceTree

  • SyncWrap::Bundle — Ruby Bundler installed (source) dependencies

  • SyncWrap::Puma

Other utilities:

  • SyncWrap::ChangeGuard — make changes transactional via a remote guard file

  • SyncWrap::TimeChecker (.check) — compare remote host system clocks

\SyncWrap makes customizing the above or implementing new components easy, as needed in your own projects.

== License

Copyright (c) 2011-2018 David Kellum

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.

FAQs

Package last updated on 07 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc