cloudmersive-voice-recognition-api-client 1.3.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +3 -28
- data/Gemfile +0 -7
- data/README.md +0 -105
- data/Rakefile +0 -8
- data/cloudmersive-voice-recognition-api-client.gemspec +0 -45
- data/docs/RecognizeApi.md +0 -63
- data/docs/SpeakApi.md +0 -121
- data/docs/SpeechRecognitionResult.md +0 -8
- data/docs/TextToSpeechRequest.md +0 -9
- data/git_push.sh +0 -55
- data/lib/cloudmersive-voice-recognition-api-client.rb +0 -43
- data/lib/cloudmersive-voice-recognition-api-client/api/recognize_api.rb +0 -79
- data/lib/cloudmersive-voice-recognition-api-client/api/speak_api.rb +0 -139
- data/lib/cloudmersive-voice-recognition-api-client/api_client.rb +0 -389
- data/lib/cloudmersive-voice-recognition-api-client/api_error.rb +0 -38
- data/lib/cloudmersive-voice-recognition-api-client/configuration.rb +0 -209
- data/lib/cloudmersive-voice-recognition-api-client/models/speech_recognition_result.rb +0 -189
- data/lib/cloudmersive-voice-recognition-api-client/models/text_to_speech_request.rb +0 -199
- data/lib/cloudmersive-voice-recognition-api-client/version.rb +0 -15
- data/spec/api/recognize_api_spec.rb +0 -47
- data/spec/api/speak_api_spec.rb +0 -60
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/speech_recognition_result_spec.rb +0 -42
- data/spec/models/text_to_speech_request_spec.rb +0 -48
- data/spec/spec_helper.rb +0 -111
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d899858a804d48defc3d934ecb7ec0d29bbf27e37d2ad8abe3d1f79d2bfd9305
|
4
|
+
data.tar.gz: 5eb8b0ebfc18841349c4a4ca854e7a2389d2a89c116936a50e4067513f312059
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a79201e57bd8aad9e2fd40e296242eeca6bdde1099e4b8009d101db5242a762800e5704b68450e0eb5c706dbbdad4170fb4354e04f7dd867aa5914b4bf20cf3
|
7
|
+
data.tar.gz: 988b6cc4040bf68a297cd11710a8f07532e9c72ed7c2fc8f3ab2744559e07b382a5a80736dea8a9f63a652a5d8032b1334f03471d09a1afcb4c931b3f0b61317
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudmersive-voice-recognition-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cloudmersive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -197,32 +197,7 @@ email:
|
|
197
197
|
executables: []
|
198
198
|
extensions: []
|
199
199
|
extra_rdoc_files: []
|
200
|
-
files:
|
201
|
-
- "./Gemfile"
|
202
|
-
- "./README.md"
|
203
|
-
- "./Rakefile"
|
204
|
-
- "./cloudmersive-voice-recognition-api-client.gemspec"
|
205
|
-
- "./docs/RecognizeApi.md"
|
206
|
-
- "./docs/SpeakApi.md"
|
207
|
-
- "./docs/SpeechRecognitionResult.md"
|
208
|
-
- "./docs/TextToSpeechRequest.md"
|
209
|
-
- "./git_push.sh"
|
210
|
-
- "./lib/cloudmersive-voice-recognition-api-client.rb"
|
211
|
-
- "./lib/cloudmersive-voice-recognition-api-client/api/recognize_api.rb"
|
212
|
-
- "./lib/cloudmersive-voice-recognition-api-client/api/speak_api.rb"
|
213
|
-
- "./lib/cloudmersive-voice-recognition-api-client/api_client.rb"
|
214
|
-
- "./lib/cloudmersive-voice-recognition-api-client/api_error.rb"
|
215
|
-
- "./lib/cloudmersive-voice-recognition-api-client/configuration.rb"
|
216
|
-
- "./lib/cloudmersive-voice-recognition-api-client/models/speech_recognition_result.rb"
|
217
|
-
- "./lib/cloudmersive-voice-recognition-api-client/models/text_to_speech_request.rb"
|
218
|
-
- "./lib/cloudmersive-voice-recognition-api-client/version.rb"
|
219
|
-
- "./spec/api/recognize_api_spec.rb"
|
220
|
-
- "./spec/api/speak_api_spec.rb"
|
221
|
-
- "./spec/api_client_spec.rb"
|
222
|
-
- "./spec/configuration_spec.rb"
|
223
|
-
- "./spec/models/speech_recognition_result_spec.rb"
|
224
|
-
- "./spec/models/text_to_speech_request_spec.rb"
|
225
|
-
- "./spec/spec_helper.rb"
|
200
|
+
files: []
|
226
201
|
homepage: https://www.cloudmersive.com/voice-recognition-and-speech-api
|
227
202
|
licenses:
|
228
203
|
- Apache 2.0
|
data/Gemfile
DELETED
data/README.md
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
# cloudmersive-voice-recognition-api-client
|
2
|
-
|
3
|
-
CloudmersiveVoiceRecognitionApiClient - the Ruby gem for the speechapi
|
4
|
-
|
5
|
-
Speech APIs enable you to recognize speech and convert it to text using advanced machine learning, and also to convert text to speech.
|
6
|
-
|
7
|
-
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
|
-
|
9
|
-
- API version: v1
|
10
|
-
- Package version: 1.3.0
|
11
|
-
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
12
|
-
|
13
|
-
## Installation
|
14
|
-
|
15
|
-
### Build a gem
|
16
|
-
|
17
|
-
To build the Ruby code into a gem:
|
18
|
-
|
19
|
-
```shell
|
20
|
-
gem build cloudmersive-voice-recognition-api-client.gemspec
|
21
|
-
```
|
22
|
-
|
23
|
-
Then either install the gem locally:
|
24
|
-
|
25
|
-
```shell
|
26
|
-
gem install ./cloudmersive-voice-recognition-api-client-1.3.0.gem
|
27
|
-
```
|
28
|
-
(for development, run `gem install --dev ./cloudmersive-voice-recognition-api-client-1.3.0.gem` to install the development dependencies)
|
29
|
-
|
30
|
-
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
31
|
-
|
32
|
-
Finally add this to the Gemfile:
|
33
|
-
|
34
|
-
gem 'cloudmersive-voice-recognition-api-client', '~> 1.3.0'
|
35
|
-
|
36
|
-
### Install from Git
|
37
|
-
|
38
|
-
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
|
39
|
-
|
40
|
-
gem 'cloudmersive-voice-recognition-api-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
41
|
-
|
42
|
-
### Include the Ruby code directly
|
43
|
-
|
44
|
-
Include the Ruby code directly using `-I` as follows:
|
45
|
-
|
46
|
-
```shell
|
47
|
-
ruby -Ilib script.rb
|
48
|
-
```
|
49
|
-
|
50
|
-
## Getting Started
|
51
|
-
|
52
|
-
Please follow the [installation](#installation) procedure and then run the following code:
|
53
|
-
```ruby
|
54
|
-
# Load the gem
|
55
|
-
require 'cloudmersive-voice-recognition-api-client'
|
56
|
-
|
57
|
-
# Setup authorization
|
58
|
-
CloudmersiveVoiceRecognitionApiClient.configure do |config|
|
59
|
-
# Configure API key authorization: Apikey
|
60
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
61
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
62
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
63
|
-
end
|
64
|
-
|
65
|
-
api_instance = CloudmersiveVoiceRecognitionApiClient::RecognizeApi.new
|
66
|
-
|
67
|
-
speech_file = File.new("/path/to/file.txt") # File | Speech file to perform the operation on. Common file formats such as WAV, MP3 are supported.
|
68
|
-
|
69
|
-
|
70
|
-
begin
|
71
|
-
#Recognize audio input as text using machine learning
|
72
|
-
result = api_instance.recognize_file(speech_file)
|
73
|
-
p result
|
74
|
-
rescue CloudmersiveVoiceRecognitionApiClient::ApiError => e
|
75
|
-
puts "Exception when calling RecognizeApi->recognize_file: #{e}"
|
76
|
-
end
|
77
|
-
|
78
|
-
```
|
79
|
-
|
80
|
-
## Documentation for API Endpoints
|
81
|
-
|
82
|
-
All URIs are relative to *https://api.cloudmersive.com*
|
83
|
-
|
84
|
-
Class | Method | HTTP request | Description
|
85
|
-
------------ | ------------- | ------------- | -------------
|
86
|
-
*CloudmersiveVoiceRecognitionApiClient::RecognizeApi* | [**recognize_file**](docs/RecognizeApi.md#recognize_file) | **POST** /speech/recognize/file | Recognize audio input as text using machine learning
|
87
|
-
*CloudmersiveVoiceRecognitionApiClient::SpeakApi* | [**speak_post**](docs/SpeakApi.md#speak_post) | **POST** /speech/speak/text/basicVoice/{format} | Perform text-to-speech on a string
|
88
|
-
*CloudmersiveVoiceRecognitionApiClient::SpeakApi* | [**speak_text_to_speech**](docs/SpeakApi.md#speak_text_to_speech) | **POST** /speech/speak/text/voice/basic/audio | Perform text-to-speech on a string
|
89
|
-
|
90
|
-
|
91
|
-
## Documentation for Models
|
92
|
-
|
93
|
-
- [CloudmersiveVoiceRecognitionApiClient::SpeechRecognitionResult](docs/SpeechRecognitionResult.md)
|
94
|
-
- [CloudmersiveVoiceRecognitionApiClient::TextToSpeechRequest](docs/TextToSpeechRequest.md)
|
95
|
-
|
96
|
-
|
97
|
-
## Documentation for Authorization
|
98
|
-
|
99
|
-
|
100
|
-
### Apikey
|
101
|
-
|
102
|
-
- **Type**: API key
|
103
|
-
- **API key parameter name**: Apikey
|
104
|
-
- **Location**: HTTP header
|
105
|
-
|
data/Rakefile
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
=begin
|
4
|
-
#speechapi
|
5
|
-
|
6
|
-
#Speech APIs enable you to recognize speech and convert it to text using advanced machine learning, and also to convert text to speech.
|
7
|
-
|
8
|
-
OpenAPI spec version: v1
|
9
|
-
|
10
|
-
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
11
|
-
Swagger Codegen version: 2.3.1
|
12
|
-
|
13
|
-
=end
|
14
|
-
|
15
|
-
$:.push File.expand_path("../lib", __FILE__)
|
16
|
-
require "cloudmersive-voice-recognition-api-client/version"
|
17
|
-
|
18
|
-
Gem::Specification.new do |s|
|
19
|
-
s.name = "cloudmersive-voice-recognition-api-client"
|
20
|
-
s.version = CloudmersiveVoiceRecognitionApiClient::VERSION
|
21
|
-
s.platform = Gem::Platform::RUBY
|
22
|
-
s.authors = ["Cloudmersive"]
|
23
|
-
s.email = [""]
|
24
|
-
s.homepage = "https://www.cloudmersive.com/voice-recognition-and-speech-api"
|
25
|
-
s.summary = "The most powerful and cost-effective speech recognition and voice AI APIs, continuously updated."
|
26
|
-
s.description = "Speech APIs enable you to recognize speech and convert it to text using advanced machine learning, and also to convert text to speech."
|
27
|
-
s.license = "Apache 2.0"
|
28
|
-
s.required_ruby_version = ">= 1.9"
|
29
|
-
|
30
|
-
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
31
|
-
s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
|
32
|
-
|
33
|
-
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
34
|
-
s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1'
|
35
|
-
s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3'
|
36
|
-
s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6'
|
37
|
-
s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2'
|
38
|
-
s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
|
39
|
-
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
|
40
|
-
|
41
|
-
s.files = Dir['./**/*']
|
42
|
-
s.test_files = `find spec/*`.split("\n")
|
43
|
-
s.executables = []
|
44
|
-
s.require_paths = ["lib"]
|
45
|
-
end
|
data/docs/RecognizeApi.md
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
# CloudmersiveVoiceRecognitionApiClient::RecognizeApi
|
2
|
-
|
3
|
-
All URIs are relative to *https://api.cloudmersive.com*
|
4
|
-
|
5
|
-
Method | HTTP request | Description
|
6
|
-
------------- | ------------- | -------------
|
7
|
-
[**recognize_file**](RecognizeApi.md#recognize_file) | **POST** /speech/recognize/file | Recognize audio input as text using machine learning
|
8
|
-
|
9
|
-
|
10
|
-
# **recognize_file**
|
11
|
-
> SpeechRecognitionResult recognize_file(speech_file)
|
12
|
-
|
13
|
-
Recognize audio input as text using machine learning
|
14
|
-
|
15
|
-
Uses advanced machine learning to convert input audio, which can be mp3 or wav, into text.
|
16
|
-
|
17
|
-
### Example
|
18
|
-
```ruby
|
19
|
-
# load the gem
|
20
|
-
require 'cloudmersive-voice-recognition-api-client'
|
21
|
-
# setup authorization
|
22
|
-
CloudmersiveVoiceRecognitionApiClient.configure do |config|
|
23
|
-
# Configure API key authorization: Apikey
|
24
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
25
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
26
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
27
|
-
end
|
28
|
-
|
29
|
-
api_instance = CloudmersiveVoiceRecognitionApiClient::RecognizeApi.new
|
30
|
-
|
31
|
-
speech_file = File.new("/path/to/file.txt") # File | Speech file to perform the operation on. Common file formats such as WAV, MP3 are supported.
|
32
|
-
|
33
|
-
|
34
|
-
begin
|
35
|
-
#Recognize audio input as text using machine learning
|
36
|
-
result = api_instance.recognize_file(speech_file)
|
37
|
-
p result
|
38
|
-
rescue CloudmersiveVoiceRecognitionApiClient::ApiError => e
|
39
|
-
puts "Exception when calling RecognizeApi->recognize_file: #{e}"
|
40
|
-
end
|
41
|
-
```
|
42
|
-
|
43
|
-
### Parameters
|
44
|
-
|
45
|
-
Name | Type | Description | Notes
|
46
|
-
------------- | ------------- | ------------- | -------------
|
47
|
-
**speech_file** | **File**| Speech file to perform the operation on. Common file formats such as WAV, MP3 are supported. |
|
48
|
-
|
49
|
-
### Return type
|
50
|
-
|
51
|
-
[**SpeechRecognitionResult**](SpeechRecognitionResult.md)
|
52
|
-
|
53
|
-
### Authorization
|
54
|
-
|
55
|
-
[Apikey](../README.md#Apikey)
|
56
|
-
|
57
|
-
### HTTP request headers
|
58
|
-
|
59
|
-
- **Content-Type**: multipart/form-data
|
60
|
-
- **Accept**: application/json, text/json, application/xml, text/xml
|
61
|
-
|
62
|
-
|
63
|
-
|
data/docs/SpeakApi.md
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
# CloudmersiveVoiceRecognitionApiClient::SpeakApi
|
2
|
-
|
3
|
-
All URIs are relative to *https://api.cloudmersive.com*
|
4
|
-
|
5
|
-
Method | HTTP request | Description
|
6
|
-
------------- | ------------- | -------------
|
7
|
-
[**speak_post**](SpeakApi.md#speak_post) | **POST** /speech/speak/text/basicVoice/{format} | Perform text-to-speech on a string
|
8
|
-
[**speak_text_to_speech**](SpeakApi.md#speak_text_to_speech) | **POST** /speech/speak/text/voice/basic/audio | Perform text-to-speech on a string
|
9
|
-
|
10
|
-
|
11
|
-
# **speak_post**
|
12
|
-
> Object speak_post(format, text)
|
13
|
-
|
14
|
-
Perform text-to-speech on a string
|
15
|
-
|
16
|
-
Takes as input a string and a file format (mp3 or wav) and outputs a wave form in the appropriate format.
|
17
|
-
|
18
|
-
### Example
|
19
|
-
```ruby
|
20
|
-
# load the gem
|
21
|
-
require 'cloudmersive-voice-recognition-api-client'
|
22
|
-
# setup authorization
|
23
|
-
CloudmersiveVoiceRecognitionApiClient.configure do |config|
|
24
|
-
# Configure API key authorization: Apikey
|
25
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
26
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
27
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
28
|
-
end
|
29
|
-
|
30
|
-
api_instance = CloudmersiveVoiceRecognitionApiClient::SpeakApi.new
|
31
|
-
|
32
|
-
format = "format_example" # String | File format to generate response in; possible values are \"mp3\" or \"wav\"
|
33
|
-
|
34
|
-
text = "text_example" # String | The text you would like to conver to speech. Be sure to surround with quotes, e.g. \"The quick brown fox jumps over the lazy dog.\"
|
35
|
-
|
36
|
-
|
37
|
-
begin
|
38
|
-
#Perform text-to-speech on a string
|
39
|
-
result = api_instance.speak_post(format, text)
|
40
|
-
p result
|
41
|
-
rescue CloudmersiveVoiceRecognitionApiClient::ApiError => e
|
42
|
-
puts "Exception when calling SpeakApi->speak_post: #{e}"
|
43
|
-
end
|
44
|
-
```
|
45
|
-
|
46
|
-
### Parameters
|
47
|
-
|
48
|
-
Name | Type | Description | Notes
|
49
|
-
------------- | ------------- | ------------- | -------------
|
50
|
-
**format** | **String**| File format to generate response in; possible values are \"mp3\" or \"wav\" |
|
51
|
-
**text** | **String**| The text you would like to conver to speech. Be sure to surround with quotes, e.g. \"The quick brown fox jumps over the lazy dog.\" |
|
52
|
-
|
53
|
-
### Return type
|
54
|
-
|
55
|
-
**Object**
|
56
|
-
|
57
|
-
### Authorization
|
58
|
-
|
59
|
-
[Apikey](../README.md#Apikey)
|
60
|
-
|
61
|
-
### HTTP request headers
|
62
|
-
|
63
|
-
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
64
|
-
- **Accept**: application/octet-stream
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
# **speak_text_to_speech**
|
69
|
-
> Object speak_text_to_speech(req_config)
|
70
|
-
|
71
|
-
Perform text-to-speech on a string
|
72
|
-
|
73
|
-
Takes as input a string and a file format (mp3 or wav) and outputs a wave form in the appropriate format.
|
74
|
-
|
75
|
-
### Example
|
76
|
-
```ruby
|
77
|
-
# load the gem
|
78
|
-
require 'cloudmersive-voice-recognition-api-client'
|
79
|
-
# setup authorization
|
80
|
-
CloudmersiveVoiceRecognitionApiClient.configure do |config|
|
81
|
-
# Configure API key authorization: Apikey
|
82
|
-
config.api_key['Apikey'] = 'YOUR API KEY'
|
83
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
84
|
-
#config.api_key_prefix['Apikey'] = 'Bearer'
|
85
|
-
end
|
86
|
-
|
87
|
-
api_instance = CloudmersiveVoiceRecognitionApiClient::SpeakApi.new
|
88
|
-
|
89
|
-
req_config = CloudmersiveVoiceRecognitionApiClient::TextToSpeechRequest.new # TextToSpeechRequest | String input request
|
90
|
-
|
91
|
-
|
92
|
-
begin
|
93
|
-
#Perform text-to-speech on a string
|
94
|
-
result = api_instance.speak_text_to_speech(req_config)
|
95
|
-
p result
|
96
|
-
rescue CloudmersiveVoiceRecognitionApiClient::ApiError => e
|
97
|
-
puts "Exception when calling SpeakApi->speak_text_to_speech: #{e}"
|
98
|
-
end
|
99
|
-
```
|
100
|
-
|
101
|
-
### Parameters
|
102
|
-
|
103
|
-
Name | Type | Description | Notes
|
104
|
-
------------- | ------------- | ------------- | -------------
|
105
|
-
**req_config** | [**TextToSpeechRequest**](TextToSpeechRequest.md)| String input request |
|
106
|
-
|
107
|
-
### Return type
|
108
|
-
|
109
|
-
**Object**
|
110
|
-
|
111
|
-
### Authorization
|
112
|
-
|
113
|
-
[Apikey](../README.md#Apikey)
|
114
|
-
|
115
|
-
### HTTP request headers
|
116
|
-
|
117
|
-
- **Content-Type**: application/json, text/json, application/xml, text/xml, application/x-www-form-urlencoded
|
118
|
-
- **Accept**: application/json, text/json, application/xml, text/xml
|
119
|
-
|
120
|
-
|
121
|
-
|
data/docs/TextToSpeechRequest.md
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
# CloudmersiveVoiceRecognitionApiClient::TextToSpeechRequest
|
2
|
-
|
3
|
-
## Properties
|
4
|
-
Name | Type | Description | Notes
|
5
|
-
------------ | ------------- | ------------- | -------------
|
6
|
-
**format** | **String** | File format for output audio file: wav or mp3, default is mp3 | [optional]
|
7
|
-
**text** | **String** | Text to be converted to speech | [optional]
|
8
|
-
|
9
|
-
|
data/git_push.sh
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
#
|
3
|
-
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
4
|
-
#
|
5
|
-
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
6
|
-
#
|
7
|
-
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
8
|
-
|
9
|
-
git_user_id=$1
|
10
|
-
git_repo_id=$2
|
11
|
-
release_note=$3
|
12
|
-
|
13
|
-
if [ "$git_user_id" = "" ]; then
|
14
|
-
git_user_id="GIT_USER_ID"
|
15
|
-
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
16
|
-
fi
|
17
|
-
|
18
|
-
if [ "$git_repo_id" = "" ]; then
|
19
|
-
git_repo_id="GIT_REPO_ID"
|
20
|
-
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
21
|
-
fi
|
22
|
-
|
23
|
-
if [ "$release_note" = "" ]; then
|
24
|
-
release_note="Minor update"
|
25
|
-
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
26
|
-
fi
|
27
|
-
|
28
|
-
# Initialize the local directory as a Git repository
|
29
|
-
git init
|
30
|
-
|
31
|
-
# Adds the files in the local repository and stages them for commit.
|
32
|
-
git add .
|
33
|
-
|
34
|
-
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
35
|
-
git commit -m "$release_note"
|
36
|
-
|
37
|
-
# Sets the new remote
|
38
|
-
git_remote=`git remote`
|
39
|
-
if [ "$git_remote" = "" ]; then # git remote not defined
|
40
|
-
|
41
|
-
if [ "$GIT_TOKEN" = "" ]; then
|
42
|
-
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
43
|
-
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
44
|
-
else
|
45
|
-
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
46
|
-
fi
|
47
|
-
|
48
|
-
fi
|
49
|
-
|
50
|
-
git pull origin master
|
51
|
-
|
52
|
-
# Pushes (Forces) the changes in the local repository up to the remote repository
|
53
|
-
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
54
|
-
git push origin master 2>&1 | grep -v 'To https'
|
55
|
-
|