capistrano-stride 0.1.0 → 0.2.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 +4 -4
- data/README.md +6 -2
- data/capistrano-stride.gemspec +0 -1
- data/lib/capistrano/stride/version.rb +1 -1
- data/lib/capistrano/tasks/stride.rake +117 -88
- metadata +2 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7261e7f7f16f7efff6ea82a1dbf23bf73cc3cd04
|
|
4
|
+
data.tar.gz: 69ff82a7351534f0dff77a04fdb69d706b600973
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 167dd19cbea197ecbbe966cb669152b9c95c3c085dd2b2d3144bd8bd9b300196f6b7bc57044aa6600ac6e31e14bcb7b15afc2ff87d336026967a733f9ff5227f
|
|
7
|
+
data.tar.gz: c454c4a7af43c1398a6a1cb2537cd28f5cd94ecff6eb4c6c418815bb9e3c33967a51cbffa9abb3ba2e961a934af9e52e6b9c2049eeff462c6ef5410aa2ae6a75
|
data/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Add this line to your application's Gemfile:
|
|
|
13
13
|
|
|
14
14
|
```ruby
|
|
15
15
|
group :deployment do
|
|
16
|
-
gem 'capistrano-stride'
|
|
16
|
+
gem 'capistrano-stride', '~> 0.2', require: false
|
|
17
17
|
end
|
|
18
18
|
```
|
|
19
19
|
|
|
@@ -45,10 +45,14 @@ Then you need to configure you Stride token and the room URL you want to notify
|
|
|
45
45
|
the new deployment
|
|
46
46
|
|
|
47
47
|
```ruby
|
|
48
|
-
set :stride_token, "YOUR TOKEN"
|
|
49
48
|
set :stride_url, "https://api.atlassian.com/site/site_id/conversation/conversation_id/message"
|
|
49
|
+
set :stride_token, "STRIDE_ACCESS_TOKEN"
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
For get Stride URL and access token you need add custom app with API tokens,
|
|
53
|
+
without installation application. Just only enter specify a token name. Simple and Easy!
|
|
54
|
+
|
|
55
|
+
|
|
52
56
|
## Contributing
|
|
53
57
|
|
|
54
58
|
1. Fork it
|
data/capistrano-stride.gemspec
CHANGED
|
@@ -1,115 +1,144 @@
|
|
|
1
|
+
require 'uri'
|
|
2
|
+
require 'net/http'
|
|
3
|
+
require 'net/https'
|
|
4
|
+
require 'json'
|
|
5
|
+
|
|
1
6
|
namespace :stride do
|
|
2
7
|
task :notify_deploy_failed do
|
|
3
8
|
message = "#{fetch(:local_user, local_user).strip} cancelled deployment of #{fetch(:application)} to #{fetch(:stage)}."
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
body = {
|
|
11
|
+
body: {
|
|
12
|
+
version: 1,
|
|
13
|
+
type: "doc",
|
|
14
|
+
content: [
|
|
15
|
+
{
|
|
16
|
+
type: "panel",
|
|
17
|
+
attrs: {
|
|
18
|
+
panelType: "warning"
|
|
19
|
+
},
|
|
20
|
+
content: [
|
|
21
|
+
{
|
|
22
|
+
type: "paragraph",
|
|
23
|
+
content: [
|
|
24
|
+
{
|
|
25
|
+
type: "text",
|
|
26
|
+
text: message
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
27
34
|
}
|
|
28
35
|
|
|
29
|
-
fetch(:
|
|
36
|
+
uri = URI.parse(fetch(:stride_url))
|
|
37
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
|
38
|
+
https.use_ssl = true
|
|
39
|
+
header = {
|
|
40
|
+
'Content-Type' => 'application/json',
|
|
41
|
+
'Authorization' => "Bearer #{fetch(:stride_token)}"
|
|
42
|
+
}
|
|
43
|
+
req = Net::HTTP::Post.new(uri.path, header)
|
|
44
|
+
req.body = body.to_json
|
|
45
|
+
https.request(req)
|
|
30
46
|
end
|
|
31
47
|
|
|
32
48
|
task :notify_deploy_started do
|
|
33
49
|
commits = `git log --no-color --max-count=5 --pretty=format:' - %an: %s' --abbrev-commit --no-merges #{fetch(:previous_revision, "HEAD")}..#{fetch(:current_revision, "HEAD")}`
|
|
34
|
-
#
|
|
35
|
-
message = "#{fetch(:local_user, local_user).strip} is deploying #{fetch(:application)} to #{fetch(:stage)} <br />"
|
|
50
|
+
message = "#{fetch(:local_user, local_user).strip} is deploying #{fetch(:application)} to #{fetch(:stage)} \n"
|
|
36
51
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
body = {
|
|
53
|
+
body: {
|
|
54
|
+
version: 1,
|
|
55
|
+
type: "doc",
|
|
56
|
+
content: [
|
|
57
|
+
{
|
|
58
|
+
type: "panel",
|
|
59
|
+
attrs: {
|
|
60
|
+
panelType: "info"
|
|
61
|
+
},
|
|
62
|
+
content: [
|
|
63
|
+
{
|
|
64
|
+
type: "paragraph",
|
|
65
|
+
content: [
|
|
66
|
+
{
|
|
67
|
+
type: "text",
|
|
68
|
+
text: message
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: "text",
|
|
72
|
+
text: commits,
|
|
73
|
+
marks: [
|
|
74
|
+
{
|
|
75
|
+
type: "code"
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
68
85
|
}
|
|
69
86
|
|
|
70
|
-
fetch(:
|
|
87
|
+
uri = URI.parse(fetch(:stride_url))
|
|
88
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
|
89
|
+
https.use_ssl = true
|
|
90
|
+
header = {
|
|
91
|
+
'Content-Type' => 'application/json',
|
|
92
|
+
'Authorization' => "Bearer #{fetch(:stride_token)}"
|
|
93
|
+
}
|
|
94
|
+
req = Net::HTTP::Post.new(uri.path, header)
|
|
95
|
+
req.body = body.to_json
|
|
96
|
+
https.request(req)
|
|
71
97
|
end
|
|
72
98
|
|
|
73
99
|
task :notify_deploy_finished do
|
|
74
100
|
message = "#{fetch(:local_user, local_user).strip} finished deploying #{fetch(:application)} to #{fetch(:stage)}."
|
|
75
101
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
102
|
+
body = {
|
|
103
|
+
body: {
|
|
104
|
+
version: 1,
|
|
105
|
+
type: "doc",
|
|
106
|
+
content: [
|
|
107
|
+
{
|
|
108
|
+
type: "panel",
|
|
109
|
+
attrs: {
|
|
110
|
+
panelType: "note"
|
|
111
|
+
},
|
|
112
|
+
content: [
|
|
113
|
+
{
|
|
114
|
+
type: "paragraph",
|
|
115
|
+
content: [
|
|
116
|
+
{
|
|
117
|
+
type: "text",
|
|
118
|
+
text: message
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
]
|
|
96
123
|
|
|
97
|
-
|
|
98
|
-
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
99
127
|
}
|
|
100
128
|
|
|
101
|
-
fetch(:
|
|
129
|
+
uri = URI.parse(fetch(:stride_url))
|
|
130
|
+
https = Net::HTTP.new(uri.host, uri.port)
|
|
131
|
+
https.use_ssl = true
|
|
132
|
+
header = {
|
|
133
|
+
'Content-Type' => 'application/json',
|
|
134
|
+
'Authorization' => "Bearer #{fetch(:stride_token)}"
|
|
135
|
+
}
|
|
136
|
+
req = Net::HTTP::Post.new(uri.path, header)
|
|
137
|
+
req.body = body.to_json
|
|
138
|
+
https.request(req)
|
|
102
139
|
end
|
|
103
140
|
|
|
104
141
|
before "deploy:updated", "stride:notify_deploy_started"
|
|
105
142
|
after "deploy:finished", "stride:notify_deploy_finished"
|
|
106
143
|
before "deploy:reverted", "stride:notify_deploy_failed"
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
namespace :load do
|
|
110
|
-
task :defaults do
|
|
111
|
-
require 'stride'
|
|
112
|
-
|
|
113
|
-
set(:client, -> {Stride::Client.new(fetch(:cloud_id), fetch(:conversation_id))})
|
|
114
|
-
end
|
|
115
144
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: capistrano-stride
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Arsen Bespalov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-04-
|
|
11
|
+
date: 2018-04-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: capistrano
|
|
@@ -24,20 +24,6 @@ dependencies:
|
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '3.2'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: stride
|
|
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
27
|
- !ruby/object:Gem::Dependency
|
|
42
28
|
name: bundler
|
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|