fullsail 0.0.2
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/lib/capistrano/fullsail.rb +1 -0
- data/lib/capistrano/fullsail/version.rb +5 -0
- data/lib/capistrano/tasks/fullsail.rake +24 -0
- data/lib/fullsail.rb +49 -0
- metadata +64 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 38d49bc83de63decd240b03732c6545b500761ee
|
4
|
+
data.tar.gz: b8891df65db755fa1ebebfe86350b72053938fea
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ce7b428af4d66c3c29c2b020e01e33d74a225022565278a113d8e67f07ac6460872a800f0cdff6a302555b8ca8a76fc4f41c9bcc9c580c74fb49d37a2c57a63d
|
7
|
+
data.tar.gz: d691902c208ddbecfb2a7caad3f17907b450fd8804551f50b3c5b7c526d31fdf7e164e41e03373821d26fc8ec67e01184a5911e15a3e85b18c5625b77053772e
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path("../tasks/fullsail.rake", __FILE__)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'capistrano/fullsail'
|
2
|
+
|
3
|
+
namespace :deploy do
|
4
|
+
task :set_commit_hash do
|
5
|
+
FullSail.setCommitHash()
|
6
|
+
end
|
7
|
+
|
8
|
+
task :fullS_starting do
|
9
|
+
FullSail.record(-1)
|
10
|
+
end
|
11
|
+
|
12
|
+
task :fullS_failed do
|
13
|
+
FullSail.record(-2)
|
14
|
+
end
|
15
|
+
|
16
|
+
task :fullS_finishing do
|
17
|
+
FullSail.record(0)
|
18
|
+
end
|
19
|
+
|
20
|
+
before :starting, :set_commit_hash
|
21
|
+
before :starting, :fullS_starting
|
22
|
+
after 'deploy:failed', :fullS_failed
|
23
|
+
after :finishing, :fullS_finishing
|
24
|
+
end
|
data/lib/fullsail.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'net/http'
|
3
|
+
require 'capistrano/all'
|
4
|
+
|
5
|
+
module FullSail
|
6
|
+
def record(status)
|
7
|
+
options = {
|
8
|
+
:application => fetch(:application),
|
9
|
+
:environment => fetch(:stage),
|
10
|
+
:status => status,
|
11
|
+
:commit_hash => @hash
|
12
|
+
}
|
13
|
+
self.deploy(options)
|
14
|
+
end
|
15
|
+
|
16
|
+
def setCommitHash
|
17
|
+
@hash = nil
|
18
|
+
@hash = `git ls-remote | grep #{fetch(:branch)} | awk '{print $1}'`
|
19
|
+
end
|
20
|
+
|
21
|
+
def url(server_url = nil)
|
22
|
+
unless server_url.include?('://')
|
23
|
+
puts "FullSail.deploy() Set Global var on your code '$URL_FULLSAIL' with valid url"
|
24
|
+
return
|
25
|
+
end
|
26
|
+
@server ||= server_url
|
27
|
+
end
|
28
|
+
|
29
|
+
def deploy(opts = {})
|
30
|
+
if !opts[:application] || !opts[:environment] || !opts[:status] || !opts[:status].is_a?(Numeric)
|
31
|
+
puts "FullSail.deploy() need 3 args: application, environment, status(numeric), [commit_hash]"
|
32
|
+
return
|
33
|
+
end
|
34
|
+
deploy = {
|
35
|
+
:application => opts[:application],
|
36
|
+
:environment => opts[:environment],
|
37
|
+
:status => opts[:status],
|
38
|
+
:commit_hash => opts[:commit_hash]
|
39
|
+
}
|
40
|
+
uri = URI(@server) # Global Var Set by User on his code 'http://api.xxx.zz/v1/deployments'
|
41
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
42
|
+
req = Net::HTTP::Post.new(uri.path)
|
43
|
+
req.add_field "Content-Type", "Application/json"
|
44
|
+
req.body = deploy.to_json
|
45
|
+
response = http.request(req)
|
46
|
+
end
|
47
|
+
|
48
|
+
extend self
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fullsail
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jean-Jacques MOIROUX
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-08-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: capistrano
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.2'
|
27
|
+
description: |-
|
28
|
+
FullSail's Gem is used to log Capistratno's
|
29
|
+
deployments into FullSail API server.
|
30
|
+
Source code on https://github.com/nectify/shipyard-cli
|
31
|
+
email: jj@fre.sc
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/capistrano/fullsail.rb
|
37
|
+
- lib/capistrano/fullsail/version.rb
|
38
|
+
- lib/capistrano/tasks/fullsail.rake
|
39
|
+
- lib/fullsail.rb
|
40
|
+
homepage: http://www.fre.sc
|
41
|
+
licenses:
|
42
|
+
- Nectify
|
43
|
+
metadata: {}
|
44
|
+
post_install_message:
|
45
|
+
rdoc_options: []
|
46
|
+
require_paths:
|
47
|
+
- lib
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
requirements: []
|
59
|
+
rubyforge_project:
|
60
|
+
rubygems_version: 2.4.1
|
61
|
+
signing_key:
|
62
|
+
specification_version: 4
|
63
|
+
summary: FullSail for Nectify
|
64
|
+
test_files: []
|