fastlane-plugin-influxdb 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +59 -0
- data/lib/fastlane/plugin/influxdb/actions/influxdb_action.rb +99 -0
- data/lib/fastlane/plugin/influxdb/helper/influxdb_helper.rb +12 -0
- data/lib/fastlane/plugin/influxdb/version.rb +5 -0
- data/lib/fastlane/plugin/influxdb.rb +16 -0
- metadata +147 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: effe6778f049c67bc0e6e3874011ac9a85e821d2
|
4
|
+
data.tar.gz: 85dd97bb9212feaaf255309eb0d9ababd7bdfa5a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3e6304fe63640bb3dbe7e5570320cdf9add7491695dd1a63eaa75016c6325593d231c76ebd192332ad14b8b59f0dfb79789cc16e23130c9d02e44f6666efa8c3
|
7
|
+
data.tar.gz: 6853d43779e3161717f7ab45bb2808f58141614ad9708ac1b089c90620590cb064273a7c1f0a63ee52385c0b9e607fdee681ef793d4f9d085217bb70e3cceb06
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Kohki Miki <koki-miki@cookpad.com>
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# influxdb plugin
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-influxdb)
|
4
|
+
[![Build Status](https://travis-ci.org/giginet/fastlane-plugin-influxdb.svg?branch=master)](https://travis-ci.org/giginet/fastlane-plugin-influxdb)
|
5
|
+
|
6
|
+
## Description
|
7
|
+
|
8
|
+
Post values to InfluxDB from your lane.
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
lane :your_lane do
|
12
|
+
indluxdb(
|
13
|
+
db_name: "sample_db",
|
14
|
+
host: "fastlane.influxdb.com",
|
15
|
+
port: 1234,
|
16
|
+
username: "sample",
|
17
|
+
password: "password",
|
18
|
+
table_name: "metrics",
|
19
|
+
values: {a: 100, b: 200, c: 300}
|
20
|
+
)
|
21
|
+
end
|
22
|
+
```
|
23
|
+
|
24
|
+
## Getting Started
|
25
|
+
|
26
|
+
This project is a [fastlane](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-influxdb`, add it to your project by running:
|
27
|
+
|
28
|
+
```bash
|
29
|
+
fastlane add_plugin influxdb
|
30
|
+
```
|
31
|
+
|
32
|
+
## Run tests for this plugin
|
33
|
+
|
34
|
+
To run both the tests, and code style validation, run
|
35
|
+
|
36
|
+
```
|
37
|
+
rake
|
38
|
+
```
|
39
|
+
|
40
|
+
To automatically fix many of the styling issues, use
|
41
|
+
```
|
42
|
+
rubocop -a
|
43
|
+
```
|
44
|
+
|
45
|
+
## Issues and Feedback
|
46
|
+
|
47
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
48
|
+
|
49
|
+
## Troubleshooting
|
50
|
+
|
51
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
52
|
+
|
53
|
+
## Using `fastlane` Plugins
|
54
|
+
|
55
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
56
|
+
|
57
|
+
## About `fastlane`
|
58
|
+
|
59
|
+
`fastlane` is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,99 @@
|
|
1
|
+
require 'influxdb'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
class InfluxdbAction < Action
|
6
|
+
def self.run(params)
|
7
|
+
client ||= InfluxDB::Client.new(
|
8
|
+
params[:db_name],
|
9
|
+
host: params[:host],
|
10
|
+
port: params[:port],
|
11
|
+
username: params[:username],
|
12
|
+
password: params[:password]
|
13
|
+
)
|
14
|
+
|
15
|
+
begin
|
16
|
+
client.write_point(params[:table_name], { values: params[:values] })
|
17
|
+
UI.success("Successfully posted values to '#{params[:table_name]}'")
|
18
|
+
rescue => e
|
19
|
+
response = JSON.parse(e.to_s)
|
20
|
+
UI.user_error!(response['error'])
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.description
|
25
|
+
"Post values to IndluxDB"
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.authors
|
29
|
+
["giginet"]
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.return_value
|
33
|
+
"nil or error message"
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.details
|
37
|
+
"Post values to InfluxDB"
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.available_options
|
41
|
+
[
|
42
|
+
FastlaneCore::ConfigItem.new(key: :db_name,
|
43
|
+
env_name: "INFLUXDB_DB_NAME",
|
44
|
+
description: "DB name of InfluxDB",
|
45
|
+
optional: false,
|
46
|
+
type: String),
|
47
|
+
FastlaneCore::ConfigItem.new(key: :host,
|
48
|
+
env_name: "INFLUXDB_HOST",
|
49
|
+
description: "Host of InfluxDB",
|
50
|
+
optional: false,
|
51
|
+
type: String),
|
52
|
+
FastlaneCore::ConfigItem.new(key: :port,
|
53
|
+
env_name: "INFLUXDB_PORT",
|
54
|
+
description: "Port of InfluxDB",
|
55
|
+
optional: false,
|
56
|
+
default_value: 8086,
|
57
|
+
type: Integer),
|
58
|
+
FastlaneCore::ConfigItem.new(key: :username,
|
59
|
+
env_name: "INFLUXDB_USERNAME",
|
60
|
+
description: "User name of InfluxDB",
|
61
|
+
optional: false,
|
62
|
+
type: String),
|
63
|
+
FastlaneCore::ConfigItem.new(key: :password,
|
64
|
+
env_name: "INFLUXDB_PASSWORD",
|
65
|
+
description: "Password of InfluxDB",
|
66
|
+
optional: false,
|
67
|
+
type: String),
|
68
|
+
FastlaneCore::ConfigItem.new(key: :table_name,
|
69
|
+
env_name: "INFLUXDB_TABLE_NAME",
|
70
|
+
description: "Table name of InfluxDB",
|
71
|
+
optional: false,
|
72
|
+
type: String),
|
73
|
+
FastlaneCore::ConfigItem.new(key: :values,
|
74
|
+
description: "Values to post",
|
75
|
+
optional: false,
|
76
|
+
type: Hash)
|
77
|
+
]
|
78
|
+
end
|
79
|
+
|
80
|
+
def self.example_code
|
81
|
+
[
|
82
|
+
'indluxdb(
|
83
|
+
db_name: "sample_db",
|
84
|
+
host: "fastlane.influxdb.com",
|
85
|
+
port: 1234,
|
86
|
+
username: "sample",
|
87
|
+
password: "password",
|
88
|
+
table_name: "metrics",
|
89
|
+
values: {a: 100, b: 200, c: 300}
|
90
|
+
)'
|
91
|
+
]
|
92
|
+
end
|
93
|
+
|
94
|
+
def self.is_supported?(platform)
|
95
|
+
true
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class InfluxdbHelper
|
4
|
+
# class methods that you define here become available in your action
|
5
|
+
# as `Helper::InfluxdbHelper.your_method`
|
6
|
+
#
|
7
|
+
def self.show_message
|
8
|
+
UI.message("Hello from the influxdb plugin helper!")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/influxdb/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Influxdb
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::Influxdb.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-influxdb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- giginet
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-03-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
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: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
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: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
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
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: fastlane
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.12.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.12.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: influxdb
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description:
|
112
|
+
email: giginet.net@gmail.com
|
113
|
+
executables: []
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files: []
|
116
|
+
files:
|
117
|
+
- LICENSE
|
118
|
+
- README.md
|
119
|
+
- lib/fastlane/plugin/influxdb.rb
|
120
|
+
- lib/fastlane/plugin/influxdb/actions/influxdb_action.rb
|
121
|
+
- lib/fastlane/plugin/influxdb/helper/influxdb_helper.rb
|
122
|
+
- lib/fastlane/plugin/influxdb/version.rb
|
123
|
+
homepage: https://github.com/giginet/fastlane-plugin-influxdb
|
124
|
+
licenses:
|
125
|
+
- MIT
|
126
|
+
metadata: {}
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
requirements: []
|
142
|
+
rubyforge_project:
|
143
|
+
rubygems_version: 2.5.2
|
144
|
+
signing_key:
|
145
|
+
specification_version: 4
|
146
|
+
summary: Post values to IndluxDB
|
147
|
+
test_files: []
|