Missile-Deploy 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +28 -0
- data/LICENSE.txt +21 -0
- data/Missile.gemspec +28 -0
- data/README.md +73 -0
- data/Rakefile +10 -0
- data/bin/missile +4 -0
- data/lib/Missile.rb +40 -0
- data/lib/Missile/deploy.rb +14 -0
- data/lib/Missile/list.rb +25 -0
- data/lib/Missile/setup.rb +26 -0
- data/lib/Missile/version.rb +3 -0
- metadata +130 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 77ee432792ab81169663a2519c61f5dcf896d248
|
4
|
+
data.tar.gz: b61229a815e3339f1e40ae9a584cb6c2b4d5d0ac
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c2833fec40cef0337adb52abfd3d940b433fed0f16f325b3edd070cca9ce91a83862b4eac8f0127658d264b623fb6ec3ea114c0df2309115b6e929ae901f3872
|
7
|
+
data.tar.gz: cacd5e2ae9b2cf4dfca02a914917795a43a770a999368475f6d7a636eb736ebd4f70a9f59c2d8140baffa76586ea1137e8ee5309917255b6a5832442f9a19d82
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
Missile (0.1.0)
|
5
|
+
net-scp
|
6
|
+
thor
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
minitest (5.8.3)
|
12
|
+
net-scp (1.2.1)
|
13
|
+
net-ssh (>= 2.6.5)
|
14
|
+
net-ssh (3.0.1)
|
15
|
+
rake (10.4.2)
|
16
|
+
thor (0.19.1)
|
17
|
+
|
18
|
+
PLATFORMS
|
19
|
+
ruby
|
20
|
+
|
21
|
+
DEPENDENCIES
|
22
|
+
Missile!
|
23
|
+
bundler (~> 1.10)
|
24
|
+
minitest
|
25
|
+
rake (~> 10.0)
|
26
|
+
|
27
|
+
BUNDLED WITH
|
28
|
+
1.10.6
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 ddymko
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/Missile.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'Missile/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "Missile-Deploy"
|
8
|
+
spec.version = Missile::VERSION
|
9
|
+
spec.authors = ["ddymko"]
|
10
|
+
spec.email = ["dymkod@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{CLI tool that allows you to do deployments}
|
13
|
+
spec.description = %q{Missile allows you to easily and quickly define what project you want to deployed to a specific location}
|
14
|
+
spec.homepage = "http://ddymko.github.io/Missile"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
spec.add_dependency 'thor'
|
24
|
+
spec.add_dependency 'net-scp'
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
26
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
27
|
+
spec.add_development_dependency "minitest"
|
28
|
+
end
|
data/README.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Missile
|
2
|
+
Welcome to Missile!
|
3
|
+
|
4
|
+
This wonderful ruby gem is a CLI tool that lets you quickly and easily specify project deployments.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'Missile'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install Missile
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
#### Setup a deployment config
|
24
|
+
So in order to run deployments you will need to setup a deployment config. To do this simply run the following
|
25
|
+
```
|
26
|
+
missile setup ['deployment config name']
|
27
|
+
```
|
28
|
+
During setup you will be prompted to enter 5 pieces of information
|
29
|
+
* host
|
30
|
+
* username
|
31
|
+
* password
|
32
|
+
* local path (path to the project on your machine)
|
33
|
+
* remote path (path to where the project will live on the remote location)
|
34
|
+
After you enter all of that information your deployment config will be saved
|
35
|
+
|
36
|
+
#### Delete a deployment config
|
37
|
+
To delete a deployment config you have created you run the setup command with the *-d* flag
|
38
|
+
```
|
39
|
+
missile setup ['deployment config name'] -d
|
40
|
+
```
|
41
|
+
|
42
|
+
#### Viewing deployment configs
|
43
|
+
To view all of the available deployment configs you have run the following:
|
44
|
+
```
|
45
|
+
missile list
|
46
|
+
```
|
47
|
+
This will return the names of all of the available deployment configs you have
|
48
|
+
|
49
|
+
#### Viewing a single deployment configs details
|
50
|
+
If you want to view the specifics of a deployment config run list command with the *-i* flag
|
51
|
+
```
|
52
|
+
missile list ['deployment config name'] -i
|
53
|
+
```
|
54
|
+
|
55
|
+
#### Deploying
|
56
|
+
To deploy your project all you need to do is run the following:
|
57
|
+
```
|
58
|
+
missile deploy ['deployment config name']
|
59
|
+
```
|
60
|
+
This will take execute deployment based on what you have set in your deployment config
|
61
|
+
|
62
|
+
|
63
|
+
## Development
|
64
|
+
|
65
|
+
|
66
|
+
## Contributing
|
67
|
+
|
68
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ddymko/Missile.
|
69
|
+
|
70
|
+
|
71
|
+
## License
|
72
|
+
|
73
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/missile
ADDED
data/lib/Missile.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require "Missile/version"
|
2
|
+
require 'thor'
|
3
|
+
require 'yaml'
|
4
|
+
require 'net/scp'
|
5
|
+
require_relative 'missile/list'
|
6
|
+
require_relative 'missile/setup'
|
7
|
+
require_relative 'missile/deploy'
|
8
|
+
|
9
|
+
module Missile
|
10
|
+
class Missile < Thor
|
11
|
+
|
12
|
+
@@file_path = File.expand_path(File.dirname(__FILE__)) + "/configs"
|
13
|
+
|
14
|
+
desc 'setup [project_name]', 'creates a config file for a specific deployment'
|
15
|
+
option :d, :type => :boolean , :desc => "Deletes specified project"
|
16
|
+
def setup(project)
|
17
|
+
options[:d] ? Setup.delete(project_path(project)) : Setup.create(project_path(project))
|
18
|
+
end
|
19
|
+
|
20
|
+
## List actions
|
21
|
+
desc 'list', 'Displays available deployments'
|
22
|
+
option :i, :type => :boolean , :desc => "[project name] -i Displays information about specific deployment setup "
|
23
|
+
def list(project="")
|
24
|
+
puts @@file_path
|
25
|
+
|
26
|
+
options[:i] ? List.info(project_path(project)) : List.list_all(@@file_path)
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'deploy PROJECT_NAME', 'this will start a deployment for the specified project'
|
30
|
+
def deploy(project)
|
31
|
+
Deploy.deploy(project_path(project))
|
32
|
+
end
|
33
|
+
|
34
|
+
no_commands{
|
35
|
+
def project_path(project)
|
36
|
+
return project_dir = @@file_path + '/' + project + '.yaml'
|
37
|
+
end
|
38
|
+
}
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class Deploy
|
2
|
+
|
3
|
+
def self.deploy(project_dir)
|
4
|
+
config = YAML.load_file(project_dir)
|
5
|
+
puts 'starting deployment'
|
6
|
+
Net::SCP.upload!(config[:host], config[:username],
|
7
|
+
config[:local_path], config[:web_path],
|
8
|
+
:ssh => {:password => config[:password]},
|
9
|
+
:recursive => true)
|
10
|
+
|
11
|
+
puts 'deployment complete'
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
data/lib/Missile/list.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
class List
|
2
|
+
|
3
|
+
def self.list_all(file_path)
|
4
|
+
if !(Dir.entries(file_path) - %w{. ..}).empty?
|
5
|
+
Dir.entries(file_path).each do |e|
|
6
|
+
puts e.chomp('.yaml') if !File.directory?(e)
|
7
|
+
end
|
8
|
+
else
|
9
|
+
puts "There are no deployment files available"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.info(project)
|
14
|
+
if File.exist?(project)
|
15
|
+
text = File.open(project)
|
16
|
+
text.each_line do |line|
|
17
|
+
puts "#{line}"
|
18
|
+
end
|
19
|
+
else
|
20
|
+
puts "The deployment file you are looking for does not exist"
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class Setup
|
2
|
+
|
3
|
+
def self.delete(project)
|
4
|
+
response = "#{project} was sucessfully deleted"
|
5
|
+
File.exist?(project) ? File.delete(project) : response = "File does not exist"
|
6
|
+
puts response
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.create(project_dir)
|
10
|
+
|
11
|
+
print 'Please enter your host > '
|
12
|
+
host = STDIN.gets.chomp
|
13
|
+
print 'Please enter your username > '
|
14
|
+
username = STDIN.gets.chomp
|
15
|
+
print 'Please enter your password > '
|
16
|
+
password = STDIN.gets.chomp
|
17
|
+
print 'Please enter web path to project > '
|
18
|
+
web_path = STDIN.gets.chomp
|
19
|
+
print 'Please enter local path to project > '
|
20
|
+
local_path = STDIN.gets.chomp
|
21
|
+
|
22
|
+
configs = {:host => host, :username => username, :password => password, :web_path => web_path, :local_path => local_path}
|
23
|
+
File.open(File.expand_path(project_dir), 'w+') { |file| file.write(configs.to_yaml) }
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: Missile-Deploy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ddymko
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-12-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: net-scp
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.10'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.10'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Missile allows you to easily and quickly define what project you want
|
84
|
+
to deployed to a specific location
|
85
|
+
email:
|
86
|
+
- dymkod@gmail.com
|
87
|
+
executables:
|
88
|
+
- missile
|
89
|
+
extensions: []
|
90
|
+
extra_rdoc_files: []
|
91
|
+
files:
|
92
|
+
- ".gitignore"
|
93
|
+
- ".travis.yml"
|
94
|
+
- Gemfile
|
95
|
+
- Gemfile.lock
|
96
|
+
- LICENSE.txt
|
97
|
+
- Missile.gemspec
|
98
|
+
- README.md
|
99
|
+
- Rakefile
|
100
|
+
- bin/missile
|
101
|
+
- lib/Missile.rb
|
102
|
+
- lib/Missile/deploy.rb
|
103
|
+
- lib/Missile/list.rb
|
104
|
+
- lib/Missile/setup.rb
|
105
|
+
- lib/Missile/version.rb
|
106
|
+
homepage: http://ddymko.github.io/Missile
|
107
|
+
licenses:
|
108
|
+
- MIT
|
109
|
+
metadata: {}
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options: []
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
124
|
+
requirements: []
|
125
|
+
rubyforge_project:
|
126
|
+
rubygems_version: 2.4.5.1
|
127
|
+
signing_key:
|
128
|
+
specification_version: 4
|
129
|
+
summary: CLI tool that allows you to do deployments
|
130
|
+
test_files: []
|