Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.1.6
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: ruby
rvm:
- 2.4.4
- 3.1.6
cache:
- bundler
script: bundle exec rspec spec
Expand Down
15 changes: 9 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
source 'http://rubygems.org'
gem 'aws-sdk-v1', '1.64'
gem 'fpm', '1.12.0'
gem 'sinatra', '1.4.6'
gem 'nokogiri', '1.10.0'
gem 'aws-sdk-s3', '~> 1.140'
gem 'aws-sdk-ec2', '~> 1.450'
gem 'fpm', '1.15.1'
gem 'sinatra', '~> 2.2'
gem 'nokogiri', '~> 1.15'
gem 'rexml' # Required for Ruby 3.0+
gem 'webrick', '~> 1.8' # Required for Ruby 3.0+ (Sinatra web server)
group :test do
gem 'rspec'
gem 'rspec-given'
gem 'rspec', '~> 3.12'
gem 'rspec-given', '~> 3.8'
end
130 changes: 72 additions & 58 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,90 +1,104 @@
GEM
remote: http://rubygems.org/
specs:
arr-pm (0.0.10)
cabin (> 0)
aws-sdk-v1 (1.64.0)
json (~> 1.4)
nokogiri (>= 1.4.4)
backports (3.21.0)
cabin (0.9.0)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
arr-pm (0.0.12)
aws-eventstream (1.4.0)
aws-partitions (1.1174.0)
aws-sdk-core (3.233.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
base64
bigdecimal
jmespath (~> 1, >= 1.6.1)
logger
aws-sdk-ec2 (1.564.0)
aws-sdk-core (~> 3, >= 3.231.0)
aws-sigv4 (~> 1.5)
aws-sdk-kms (1.114.0)
aws-sdk-core (~> 3, >= 3.231.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.200.0)
aws-sdk-core (~> 3, >= 3.231.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.12.1)
aws-eventstream (~> 1, >= 1.0.2)
backports (3.25.2)
base64 (0.3.0)
bigdecimal (3.3.1)
cabin (0.9.1)
clamp (1.0.1)
diff-lcs (1.4.4)
dotenv (2.7.6)
ffi (1.12.2)
fpm (1.12.0)
arr-pm (~> 0.0.10)
diff-lcs (1.6.2)
dotenv (2.8.1)
fpm (1.15.1)
arr-pm (~> 0.0.11)
backports (>= 2.6.2)
cabin (>= 0.6.0)
childprocess (< 1.0.0)
clamp (~> 1.0.0)
ffi (~> 1.12.0)
git (>= 1.3.0, < 2.0)
json (>= 1.7.7, < 3.0)
pleaserun (~> 0.0.29)
ruby-xz (~> 0.2.3)
rexml
stud
git (1.8.1)
rchardet (~> 1.8)
given_core (3.8.2)
sorcerer (>= 0.3.7)
insist (1.0.0)
io-like (0.3.1)
json (1.8.6)
mini_portile2 (2.4.0)
jmespath (1.6.2)
logger (1.7.0)
mustache (0.99.8)
nokogiri (1.10.0)
mini_portile2 (~> 2.4.0)
pleaserun (0.0.32)
mustermann (2.0.2)
ruby2_keywords (~> 0.0.1)
nokogiri (1.18.10-arm64-darwin)
racc (~> 1.4)
pleaserun (0.0.33)
cabin (> 0)
clamp
dotenv
dotenv (~> 2)
insist
mustache (= 0.99.8)
stud
rack (1.6.13)
rack-protection (1.5.5)
racc (1.8.1)
rack (2.2.20)
rack-protection (2.2.4)
rack
rchardet (1.8.0)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
rexml (3.4.4)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (~> 3.13.0)
rspec-given (3.8.2)
given_core (= 3.8.2)
rspec (>= 2.14.0)
rspec-mocks (3.10.2)
rspec-mocks (3.13.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
ruby-xz (0.2.3)
ffi (~> 1.9)
io-like (~> 0.3)
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
rspec-support (~> 3.13.0)
rspec-support (3.13.6)
ruby2_keywords (0.0.5)
sinatra (2.2.4)
mustermann (~> 2.0)
rack (~> 2.2)
rack-protection (= 2.2.4)
tilt (~> 2.0)
sorcerer (2.0.1)
stud (0.0.23)
tilt (2.0.10)
tilt (2.6.1)

PLATFORMS
x86_64-linux
arm64-darwin-24

DEPENDENCIES
aws-sdk-v1 (= 1.64)
fpm (= 1.12.0)
nokogiri (= 1.10.0)
rspec
rspec-given
sinatra (= 1.4.6)
aws-sdk-ec2 (~> 1.450)
aws-sdk-s3 (~> 1.140)
fpm (= 1.15.1)
nokogiri (~> 1.15)
rexml
rspec (~> 3.12)
rspec-given (~> 3.8)
sinatra (~> 2.2)

BUNDLED WITH
2.2.17
2.3.27
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,14 @@ $ gem build ploy.gemspec

## Requirements

- ruby 1.9+
- fpm
- ruby 3.1.6
- fpm 1.15.1+
- aws-sdk-s3
- aws-sdk-ec2
- rsync
- dpkg (for tests)

Known to work on OSX and Ubuntu.
Known to work on macOS and Ubuntu.

### Legal

Expand Down
4 changes: 2 additions & 2 deletions lib/ploy/command/oracle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
module Ploy
module Command
class OracleServer < Sinatra::Base
set :port => 9876
set :bind => '0.0.0.0'
set :port, 9876
set :bind, '0.0.0.0'

def self.oracle_run(metasrc)
@@metasrc = metasrc # this could not be sadder
Expand Down
5 changes: 4 additions & 1 deletion lib/ploy/metaoracle.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
require 'net/http'
require 'json'
require 'aws-sdk-ec2'

module Ploy
class MetaOracle
def initialize(stack)
@stack = stack
@ec2 = Aws::EC2::Resource.new
end

def query
r = {}
puts "query"
AWS::EC2.new.instances.tagged_values(@stack).each do |i|
# Find instances with the stack tag
@ec2.instances(filters: [{name: 'tag:Name', values: [@stack]}]).each do |i|
puts "asking #{i.private_ip_address}"
r[i.private_ip_address] = meta(i)
end
Expand Down
2 changes: 2 additions & 0 deletions lib/ploy/packageset.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'ploy/package'

module Ploy
class PackageSet
attr_accessor :packages
Expand Down
44 changes: 24 additions & 20 deletions lib/ploy/s3storage.rb
Original file line number Diff line number Diff line change
@@ -1,53 +1,57 @@
require 'aws-sdk-v1'
require 'aws-sdk-s3'

module Ploy
class S3Storage
def initialize(bucket)
@bucketname = bucket
@s3 = Aws::S3::Resource.new
@bucket = @s3.bucket(@bucketname)
end

def put(path, name, meta = {})
AWS::S3.new.buckets[@bucketname].objects[name].write(
Pathname.new(path),
{ :metadata => meta }
)
obj = @bucket.object(name)
File.open(path.to_s, 'rb') do |file|
obj.put(body: file, metadata: meta)
end
end

def copy(from, to)
AWS::S3.new.buckets[@bucketname].objects[from].copy_to(to)
@bucket.object(to).copy_from(
copy_source: "#{@bucketname}/#{from}"
)
end

def read(from)
AWS::S3.new.buckets[@bucketname].objects[from].read
@bucket.object(from).get.body.read
end

def get(from, fileio)
AWS::S3.new.buckets[@bucketname].objects[from].read do |chunk|
@bucket.object(from).get do |chunk|
fileio.write(chunk)
end
fileio.flush
end

def metadata(loc)
o = AWS::S3.new.buckets[@bucketname].objects[loc]
if (o.exists?) then
return o.metadata
else
return {}
obj = @bucket.object(loc)
begin
obj.head.metadata
rescue Aws::S3::Errors::NotFound
{}
end
end

def list
tree = AWS::S3.new.buckets[@bucketname].as_tree
dirs = tree.children.select(&:branch?).collect(&:prefix)
package_names = []
dirs.each do |dir|
dir.chop!
if dir != 'hub' && dir != 'blessed' && dir != 'staging'
package_names.push(dir)
# List objects with delimiter to get "directories"
@bucket.objects(delimiter: '/').each do |obj_summary|
prefix = obj_summary.key
prefix.chop! if prefix.end_with?('/')
unless ['hub', 'blessed', 'staging'].include?(prefix)
package_names.push(prefix)
end
end
return package_names
package_names
end
end
end
10 changes: 6 additions & 4 deletions ploy.gemspec → ploy-2.7.8.gemspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
Gem::Specification.new do |s|
s.name = 'ploy'
s.version = '0.0.42'
s.date = '2021-05-17'
s.name = 'ploy-2.7.8'
s.version = '0.0.43'
s.date = '2025-10-08'
s.summary = 'Multi-phase deployment tool'
s.description = 'Multi-phase deployment tool for use in a continuous deployment environment.'
s.authors = ["Michael Bruce", "Brian J. Schrock", "Dustin Watson"]
s.email = 'mbruce@manta.com'
s.files += Dir['lib/**/*.rb']
s.required_ruby_version = '>= 2.7.8'
s.add_runtime_dependency 'aws-sdk-v1', '1.64'
s.add_runtime_dependency 'fpm', '1.12.0'
s.add_runtime_dependency 'fpm', '1.15.1'
s.add_runtime_dependency 'sinatra', '1.4.6'
s.add_runtime_dependency 'nokogiri', '~> 1.13.0'
s.executables << 'ploy'
end
18 changes: 18 additions & 0 deletions ploy-3.1.6.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Gem::Specification.new do |s|
s.name = 'ploy-3.1.6'
s.version = '0.0.46'
s.date = '2025-10-21'
s.summary = 'Multi-phase deployment tool'
s.description = 'Multi-phase deployment tool for use in a continuous deployment environment.'
s.authors = ["Michael Bruce", "Brian J. Schrock", "Dustin Watson"]
s.email = 'mbruce@manta.com'
s.files += Dir['lib/**/*.rb']
s.required_ruby_version = '>= 3.1.0'
s.add_runtime_dependency 'aws-sdk-s3', '~> 1.140'
s.add_runtime_dependency 'aws-sdk-ec2', '~> 1.450'
s.add_runtime_dependency 'fpm', '1.15.1'
s.add_runtime_dependency 'sinatra', '~> 2.2'
s.add_runtime_dependency 'nokogiri', '~> 1.15'
s.add_runtime_dependency 'webrick', '~> 1.8'
s.executables << 'ploy'
end
Loading