pulp_2to3_migration_client 0.3.0b1.dev01595360000
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/Gemfile +9 -0
- data/README.md +114 -0
- data/Rakefile +10 -0
- data/docs/AsyncOperationResponse.md +17 -0
- data/docs/InlineResponse200.md +23 -0
- data/docs/InlineResponse2001.md +23 -0
- data/docs/InlineResponse2002.md +23 -0
- data/docs/MigrationPlanRun.md +19 -0
- data/docs/MigrationPlansApi.md +295 -0
- data/docs/Pulp2contentApi.md +154 -0
- data/docs/Pulp2repositoriesApi.md +140 -0
- data/docs/Pulp2to3MigrationMigrationPlan.md +21 -0
- data/docs/Pulp2to3MigrationPulp2Content.md +33 -0
- data/docs/Pulp2to3MigrationPulp2Repository.md +39 -0
- data/git_push.sh +58 -0
- data/lib/pulp_2to3_migration_client.rb +50 -0
- data/lib/pulp_2to3_migration_client/api/migration_plans_api.rb +355 -0
- data/lib/pulp_2to3_migration_client/api/pulp2content_api.rb +194 -0
- data/lib/pulp_2to3_migration_client/api/pulp2repositories_api.rb +173 -0
- data/lib/pulp_2to3_migration_client/api_client.rb +402 -0
- data/lib/pulp_2to3_migration_client/api_error.rb +57 -0
- data/lib/pulp_2to3_migration_client/configuration.rb +243 -0
- data/lib/pulp_2to3_migration_client/models/async_operation_response.rb +212 -0
- data/lib/pulp_2to3_migration_client/models/inline_response200.rb +247 -0
- data/lib/pulp_2to3_migration_client/models/inline_response2001.rb +247 -0
- data/lib/pulp_2to3_migration_client/models/inline_response2002.rb +247 -0
- data/lib/pulp_2to3_migration_client/models/migration_plan_run.rb +221 -0
- data/lib/pulp_2to3_migration_client/models/pulp2to3_migration_migration_plan.rb +231 -0
- data/lib/pulp_2to3_migration_client/models/pulp2to3_migration_pulp2_content.rb +393 -0
- data/lib/pulp_2to3_migration_client/models/pulp2to3_migration_pulp2_repository.rb +444 -0
- data/lib/pulp_2to3_migration_client/version.rb +15 -0
- data/pulp_2to3_migration_client.gemspec +39 -0
- data/spec/api/migration_plans_api_spec.rb +102 -0
- data/spec/api/pulp2content_api_spec.rb +76 -0
- data/spec/api/pulp2repositories_api_spec.rb +69 -0
- data/spec/api_client_spec.rb +188 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/async_operation_response_spec.rb +41 -0
- data/spec/models/inline_response2001_spec.rb +59 -0
- data/spec/models/inline_response2002_spec.rb +59 -0
- data/spec/models/inline_response200_spec.rb +59 -0
- data/spec/models/migration_plan_run_spec.rb +47 -0
- data/spec/models/pulp2to3_migration_migration_plan_spec.rb +53 -0
- data/spec/models/pulp2to3_migration_pulp2_content_spec.rb +89 -0
- data/spec/models/pulp2to3_migration_pulp2_repository_spec.rb +107 -0
- data/spec/spec_helper.rb +111 -0
- metadata +157 -0
@@ -0,0 +1,154 @@
|
|
1
|
+
# Pulp2to3MigrationClient::Pulp2contentApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://pulp*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**list**](Pulp2contentApi.md#list) | **GET** /pulp/api/v3/pulp2content/ | List pulp2 contents
|
8
|
+
[**read**](Pulp2contentApi.md#read) | **GET** {pulp2_content_href} | Inspect a pulp2 content
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
## list
|
13
|
+
|
14
|
+
> InlineResponse2001 list(opts)
|
15
|
+
|
16
|
+
List pulp2 contents
|
17
|
+
|
18
|
+
ViewSet for Pulp2Content model.
|
19
|
+
|
20
|
+
### Example
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
# load the gem
|
24
|
+
require 'pulp_2to3_migration_client'
|
25
|
+
# setup authorization
|
26
|
+
Pulp2to3MigrationClient.configure do |config|
|
27
|
+
# Configure HTTP basic authorization: Basic
|
28
|
+
config.username = 'YOUR USERNAME'
|
29
|
+
config.password = 'YOUR PASSWORD'
|
30
|
+
end
|
31
|
+
|
32
|
+
api_instance = Pulp2to3MigrationClient::Pulp2contentApi.new
|
33
|
+
opts = {
|
34
|
+
ordering: 'ordering_example', # String | Which field to use when ordering the results.
|
35
|
+
pulp2_id: 'pulp2_id_example', # String |
|
36
|
+
pulp2_id__in: 'pulp2_id__in_example', # String | Filter results where pulp2_id is in a comma-separated list of values
|
37
|
+
pulp2_content_type_id: 'pulp2_content_type_id_example', # String |
|
38
|
+
pulp2_content_type_id__in: 'pulp2_content_type_id__in_example', # String | Filter results where pulp2_content_type_id is in a comma-separated list of values
|
39
|
+
pulp2_last_updated__lt: 3.4, # Float | Filter results where pulp2_last_updated is less than value
|
40
|
+
pulp2_last_updated__lte: 3.4, # Float | Filter results where pulp2_last_updated is less than or equal to value
|
41
|
+
pulp2_last_updated__gt: 3.4, # Float | Filter results where pulp2_last_updated is greater than value
|
42
|
+
pulp2_last_updated__gte: 3.4, # Float | Filter results where pulp2_last_updated is greater than or equal to value
|
43
|
+
pulp2_last_updated__range: 3.4, # Float | Filter results where pulp2_last_updated is between two comma separated values
|
44
|
+
pulp3_content: 'pulp3_content_example', # String | Foreign Key referenced by HREF
|
45
|
+
pulp2_last_updated: 'pulp2_last_updated_example', # String | ISO 8601 formatted dates are supported
|
46
|
+
limit: 56, # Integer | Number of results to return per page.
|
47
|
+
offset: 56, # Integer | The initial index from which to return the results.
|
48
|
+
fields: 'fields_example', # String | A list of fields to include in the response.
|
49
|
+
exclude_fields: 'exclude_fields_example' # String | A list of fields to exclude from the response.
|
50
|
+
}
|
51
|
+
|
52
|
+
begin
|
53
|
+
#List pulp2 contents
|
54
|
+
result = api_instance.list(opts)
|
55
|
+
p result
|
56
|
+
rescue Pulp2to3MigrationClient::ApiError => e
|
57
|
+
puts "Exception when calling Pulp2contentApi->list: #{e}"
|
58
|
+
end
|
59
|
+
```
|
60
|
+
|
61
|
+
### Parameters
|
62
|
+
|
63
|
+
|
64
|
+
Name | Type | Description | Notes
|
65
|
+
------------- | ------------- | ------------- | -------------
|
66
|
+
**ordering** | **String**| Which field to use when ordering the results. | [optional]
|
67
|
+
**pulp2_id** | **String**| | [optional]
|
68
|
+
**pulp2_id__in** | **String**| Filter results where pulp2_id is in a comma-separated list of values | [optional]
|
69
|
+
**pulp2_content_type_id** | **String**| | [optional]
|
70
|
+
**pulp2_content_type_id__in** | **String**| Filter results where pulp2_content_type_id is in a comma-separated list of values | [optional]
|
71
|
+
**pulp2_last_updated__lt** | **Float**| Filter results where pulp2_last_updated is less than value | [optional]
|
72
|
+
**pulp2_last_updated__lte** | **Float**| Filter results where pulp2_last_updated is less than or equal to value | [optional]
|
73
|
+
**pulp2_last_updated__gt** | **Float**| Filter results where pulp2_last_updated is greater than value | [optional]
|
74
|
+
**pulp2_last_updated__gte** | **Float**| Filter results where pulp2_last_updated is greater than or equal to value | [optional]
|
75
|
+
**pulp2_last_updated__range** | **Float**| Filter results where pulp2_last_updated is between two comma separated values | [optional]
|
76
|
+
**pulp3_content** | **String**| Foreign Key referenced by HREF | [optional]
|
77
|
+
**pulp2_last_updated** | **String**| ISO 8601 formatted dates are supported | [optional]
|
78
|
+
**limit** | **Integer**| Number of results to return per page. | [optional]
|
79
|
+
**offset** | **Integer**| The initial index from which to return the results. | [optional]
|
80
|
+
**fields** | **String**| A list of fields to include in the response. | [optional]
|
81
|
+
**exclude_fields** | **String**| A list of fields to exclude from the response. | [optional]
|
82
|
+
|
83
|
+
### Return type
|
84
|
+
|
85
|
+
[**InlineResponse2001**](InlineResponse2001.md)
|
86
|
+
|
87
|
+
### Authorization
|
88
|
+
|
89
|
+
[Basic](../README.md#Basic)
|
90
|
+
|
91
|
+
### HTTP request headers
|
92
|
+
|
93
|
+
- **Content-Type**: Not defined
|
94
|
+
- **Accept**: application/json
|
95
|
+
|
96
|
+
|
97
|
+
## read
|
98
|
+
|
99
|
+
> Pulp2to3MigrationPulp2Content read(pulp2_content_href, opts)
|
100
|
+
|
101
|
+
Inspect a pulp2 content
|
102
|
+
|
103
|
+
ViewSet for Pulp2Content model.
|
104
|
+
|
105
|
+
### Example
|
106
|
+
|
107
|
+
```ruby
|
108
|
+
# load the gem
|
109
|
+
require 'pulp_2to3_migration_client'
|
110
|
+
# setup authorization
|
111
|
+
Pulp2to3MigrationClient.configure do |config|
|
112
|
+
# Configure HTTP basic authorization: Basic
|
113
|
+
config.username = 'YOUR USERNAME'
|
114
|
+
config.password = 'YOUR PASSWORD'
|
115
|
+
end
|
116
|
+
|
117
|
+
api_instance = Pulp2to3MigrationClient::Pulp2contentApi.new
|
118
|
+
pulp2_content_href = 'pulp2_content_href_example' # String | URI of Pulp2 Content. e.g.: /pulp/api/v3/pulp2content/1/
|
119
|
+
opts = {
|
120
|
+
fields: 'fields_example', # String | A list of fields to include in the response.
|
121
|
+
exclude_fields: 'exclude_fields_example' # String | A list of fields to exclude from the response.
|
122
|
+
}
|
123
|
+
|
124
|
+
begin
|
125
|
+
#Inspect a pulp2 content
|
126
|
+
result = api_instance.read(pulp2_content_href, opts)
|
127
|
+
p result
|
128
|
+
rescue Pulp2to3MigrationClient::ApiError => e
|
129
|
+
puts "Exception when calling Pulp2contentApi->read: #{e}"
|
130
|
+
end
|
131
|
+
```
|
132
|
+
|
133
|
+
### Parameters
|
134
|
+
|
135
|
+
|
136
|
+
Name | Type | Description | Notes
|
137
|
+
------------- | ------------- | ------------- | -------------
|
138
|
+
**pulp2_content_href** | **String**| URI of Pulp2 Content. e.g.: /pulp/api/v3/pulp2content/1/ |
|
139
|
+
**fields** | **String**| A list of fields to include in the response. | [optional]
|
140
|
+
**exclude_fields** | **String**| A list of fields to exclude from the response. | [optional]
|
141
|
+
|
142
|
+
### Return type
|
143
|
+
|
144
|
+
[**Pulp2to3MigrationPulp2Content**](Pulp2to3MigrationPulp2Content.md)
|
145
|
+
|
146
|
+
### Authorization
|
147
|
+
|
148
|
+
[Basic](../README.md#Basic)
|
149
|
+
|
150
|
+
### HTTP request headers
|
151
|
+
|
152
|
+
- **Content-Type**: Not defined
|
153
|
+
- **Accept**: application/json
|
154
|
+
|
@@ -0,0 +1,140 @@
|
|
1
|
+
# Pulp2to3MigrationClient::Pulp2repositoriesApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://pulp*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**list**](Pulp2repositoriesApi.md#list) | **GET** /pulp/api/v3/pulp2repositories/ | List pulp2 repositorys
|
8
|
+
[**read**](Pulp2repositoriesApi.md#read) | **GET** {pulp2_repository_href} | Inspect a pulp2 repository
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
## list
|
13
|
+
|
14
|
+
> InlineResponse2002 list(opts)
|
15
|
+
|
16
|
+
List pulp2 repositorys
|
17
|
+
|
18
|
+
ViewSet for Pulp2Repositories model.
|
19
|
+
|
20
|
+
### Example
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
# load the gem
|
24
|
+
require 'pulp_2to3_migration_client'
|
25
|
+
# setup authorization
|
26
|
+
Pulp2to3MigrationClient.configure do |config|
|
27
|
+
# Configure HTTP basic authorization: Basic
|
28
|
+
config.username = 'YOUR USERNAME'
|
29
|
+
config.password = 'YOUR PASSWORD'
|
30
|
+
end
|
31
|
+
|
32
|
+
api_instance = Pulp2to3MigrationClient::Pulp2repositoriesApi.new
|
33
|
+
opts = {
|
34
|
+
ordering: 'ordering_example', # String | Which field to use when ordering the results.
|
35
|
+
pulp2_repo_id: 'pulp2_repo_id_example', # String |
|
36
|
+
pulp2_repo_id__in: 'pulp2_repo_id__in_example', # String | Filter results where pulp2_repo_id is in a comma-separated list of values
|
37
|
+
is_migrated: 'is_migrated_example', # String |
|
38
|
+
not_in_plan: 'not_in_plan_example', # String |
|
39
|
+
limit: 56, # Integer | Number of results to return per page.
|
40
|
+
offset: 56, # Integer | The initial index from which to return the results.
|
41
|
+
fields: 'fields_example', # String | A list of fields to include in the response.
|
42
|
+
exclude_fields: 'exclude_fields_example' # String | A list of fields to exclude from the response.
|
43
|
+
}
|
44
|
+
|
45
|
+
begin
|
46
|
+
#List pulp2 repositorys
|
47
|
+
result = api_instance.list(opts)
|
48
|
+
p result
|
49
|
+
rescue Pulp2to3MigrationClient::ApiError => e
|
50
|
+
puts "Exception when calling Pulp2repositoriesApi->list: #{e}"
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
### Parameters
|
55
|
+
|
56
|
+
|
57
|
+
Name | Type | Description | Notes
|
58
|
+
------------- | ------------- | ------------- | -------------
|
59
|
+
**ordering** | **String**| Which field to use when ordering the results. | [optional]
|
60
|
+
**pulp2_repo_id** | **String**| | [optional]
|
61
|
+
**pulp2_repo_id__in** | **String**| Filter results where pulp2_repo_id is in a comma-separated list of values | [optional]
|
62
|
+
**is_migrated** | **String**| | [optional]
|
63
|
+
**not_in_plan** | **String**| | [optional]
|
64
|
+
**limit** | **Integer**| Number of results to return per page. | [optional]
|
65
|
+
**offset** | **Integer**| The initial index from which to return the results. | [optional]
|
66
|
+
**fields** | **String**| A list of fields to include in the response. | [optional]
|
67
|
+
**exclude_fields** | **String**| A list of fields to exclude from the response. | [optional]
|
68
|
+
|
69
|
+
### Return type
|
70
|
+
|
71
|
+
[**InlineResponse2002**](InlineResponse2002.md)
|
72
|
+
|
73
|
+
### Authorization
|
74
|
+
|
75
|
+
[Basic](../README.md#Basic)
|
76
|
+
|
77
|
+
### HTTP request headers
|
78
|
+
|
79
|
+
- **Content-Type**: Not defined
|
80
|
+
- **Accept**: application/json
|
81
|
+
|
82
|
+
|
83
|
+
## read
|
84
|
+
|
85
|
+
> Pulp2to3MigrationPulp2Repository read(pulp2_repository_href, opts)
|
86
|
+
|
87
|
+
Inspect a pulp2 repository
|
88
|
+
|
89
|
+
ViewSet for Pulp2Repositories model.
|
90
|
+
|
91
|
+
### Example
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
# load the gem
|
95
|
+
require 'pulp_2to3_migration_client'
|
96
|
+
# setup authorization
|
97
|
+
Pulp2to3MigrationClient.configure do |config|
|
98
|
+
# Configure HTTP basic authorization: Basic
|
99
|
+
config.username = 'YOUR USERNAME'
|
100
|
+
config.password = 'YOUR PASSWORD'
|
101
|
+
end
|
102
|
+
|
103
|
+
api_instance = Pulp2to3MigrationClient::Pulp2repositoriesApi.new
|
104
|
+
pulp2_repository_href = 'pulp2_repository_href_example' # String | URI of Pulp2 Repository. e.g.: /pulp/api/v3/pulp2repositories/1/
|
105
|
+
opts = {
|
106
|
+
fields: 'fields_example', # String | A list of fields to include in the response.
|
107
|
+
exclude_fields: 'exclude_fields_example' # String | A list of fields to exclude from the response.
|
108
|
+
}
|
109
|
+
|
110
|
+
begin
|
111
|
+
#Inspect a pulp2 repository
|
112
|
+
result = api_instance.read(pulp2_repository_href, opts)
|
113
|
+
p result
|
114
|
+
rescue Pulp2to3MigrationClient::ApiError => e
|
115
|
+
puts "Exception when calling Pulp2repositoriesApi->read: #{e}"
|
116
|
+
end
|
117
|
+
```
|
118
|
+
|
119
|
+
### Parameters
|
120
|
+
|
121
|
+
|
122
|
+
Name | Type | Description | Notes
|
123
|
+
------------- | ------------- | ------------- | -------------
|
124
|
+
**pulp2_repository_href** | **String**| URI of Pulp2 Repository. e.g.: /pulp/api/v3/pulp2repositories/1/ |
|
125
|
+
**fields** | **String**| A list of fields to include in the response. | [optional]
|
126
|
+
**exclude_fields** | **String**| A list of fields to exclude from the response. | [optional]
|
127
|
+
|
128
|
+
### Return type
|
129
|
+
|
130
|
+
[**Pulp2to3MigrationPulp2Repository**](Pulp2to3MigrationPulp2Repository.md)
|
131
|
+
|
132
|
+
### Authorization
|
133
|
+
|
134
|
+
[Basic](../README.md#Basic)
|
135
|
+
|
136
|
+
### HTTP request headers
|
137
|
+
|
138
|
+
- **Content-Type**: Not defined
|
139
|
+
- **Accept**: application/json
|
140
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Pulp2to3MigrationClient::Pulp2to3MigrationMigrationPlan
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**pulp_href** | **String** | | [optional] [readonly]
|
8
|
+
**pulp_created** | **DateTime** | Timestamp of creation. | [optional] [readonly]
|
9
|
+
**plan** | [**Object**](.md) | Migration Plan in JSON format |
|
10
|
+
|
11
|
+
## Code Sample
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'Pulp2to3MigrationClient'
|
15
|
+
|
16
|
+
instance = Pulp2to3MigrationClient::Pulp2to3MigrationMigrationPlan.new(pulp_href: null,
|
17
|
+
pulp_created: null,
|
18
|
+
plan: null)
|
19
|
+
```
|
20
|
+
|
21
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Pulp2to3MigrationClient::Pulp2to3MigrationPulp2Content
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**pulp_href** | **String** | | [optional] [readonly]
|
8
|
+
**pulp_created** | **DateTime** | Timestamp of creation. | [optional] [readonly]
|
9
|
+
**pulp2_id** | **String** | |
|
10
|
+
**pulp2_content_type_id** | **String** | |
|
11
|
+
**pulp2_last_updated** | **Integer** | |
|
12
|
+
**pulp2_storage_path** | **String** | |
|
13
|
+
**downloaded** | **Boolean** | | [optional] [default to false]
|
14
|
+
**pulp3_content** | **String** | | [optional]
|
15
|
+
**pulp3_repository_version** | **String** | Get pulp3_repository_version href from pulp2repo if available | [optional] [readonly]
|
16
|
+
|
17
|
+
## Code Sample
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
require 'Pulp2to3MigrationClient'
|
21
|
+
|
22
|
+
instance = Pulp2to3MigrationClient::Pulp2to3MigrationPulp2Content.new(pulp_href: null,
|
23
|
+
pulp_created: null,
|
24
|
+
pulp2_id: null,
|
25
|
+
pulp2_content_type_id: null,
|
26
|
+
pulp2_last_updated: null,
|
27
|
+
pulp2_storage_path: null,
|
28
|
+
downloaded: null,
|
29
|
+
pulp3_content: null,
|
30
|
+
pulp3_repository_version: null)
|
31
|
+
```
|
32
|
+
|
33
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Pulp2to3MigrationClient::Pulp2to3MigrationPulp2Repository
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**pulp_href** | **String** | | [optional] [readonly]
|
8
|
+
**pulp_created** | **DateTime** | Timestamp of creation. | [optional] [readonly]
|
9
|
+
**pulp2_object_id** | **String** | |
|
10
|
+
**pulp2_repo_id** | **String** | |
|
11
|
+
**pulp2_repo_type** | **String** | |
|
12
|
+
**is_migrated** | **Boolean** | | [optional] [default to false]
|
13
|
+
**not_in_plan** | **Boolean** | | [optional] [default to false]
|
14
|
+
**pulp3_repository_version** | **String** | RepositoryVersion to be served | [optional]
|
15
|
+
**pulp3_remote_href** | **String** | Get pulp3_remote_href from pulp2repo | [optional] [readonly]
|
16
|
+
**pulp3_publication_href** | **String** | Get pulp3_publication_href from pulp3_repository_version | [optional] [readonly]
|
17
|
+
**pulp3_distribution_hrefs** | **Array<String>** | Get pulp3_distribution_hrefs from pulp3_repository_version | [optional] [readonly]
|
18
|
+
**pulp3_repository_href** | **String** | Get pulp3_repository_href from pulp2repo | [optional] [readonly]
|
19
|
+
|
20
|
+
## Code Sample
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
require 'Pulp2to3MigrationClient'
|
24
|
+
|
25
|
+
instance = Pulp2to3MigrationClient::Pulp2to3MigrationPulp2Repository.new(pulp_href: null,
|
26
|
+
pulp_created: null,
|
27
|
+
pulp2_object_id: null,
|
28
|
+
pulp2_repo_id: null,
|
29
|
+
pulp2_repo_type: null,
|
30
|
+
is_migrated: null,
|
31
|
+
not_in_plan: null,
|
32
|
+
pulp3_repository_version: null,
|
33
|
+
pulp3_remote_href: null,
|
34
|
+
pulp3_publication_href: null,
|
35
|
+
pulp3_distribution_hrefs: null,
|
36
|
+
pulp3_repository_href: null)
|
37
|
+
```
|
38
|
+
|
39
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=`git remote`
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
58
|
+
|