gleis 0.6.2 → 0.7.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/CHANGELOG.md +17 -0
- data/exe/gleis +1 -1
- data/lib/gleis/api.rb +9 -7
- data/lib/gleis/application.rb +13 -1
- data/lib/gleis/cli/app.rb +5 -0
- data/lib/gleis/config.rb +1 -1
- data/lib/gleis/management.rb +1 -1
- data/lib/gleis/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 063df2154d7dfcdf43373c24c6e2716b266cbfb65e3ab7778a689731141761b3
|
4
|
+
data.tar.gz: cddf0a769273d7479d4cc2d9d202ac973668034841e8985b14a6f4f879244c79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f24f837e150704e7b4c3d9c24a58f060249cf25e30e352273ff6e539a6a641025b04816b7594ba4a1412b12d54ae7232af423a3cc76630166c18dc9c0c4a3db1
|
7
|
+
data.tar.gz: 64a6eb9fea21950f26e94130b33c3a63651ea1308a6a3460cd8efbafc834925fb6eb7d512abec86cb0acd35a06e61f8ca8d8dae83c4e854496ec2cbaf021263f
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,23 @@ All notable changes to the Gleis CLI will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## 0.7.0 - 2020-03-07
|
9
|
+
|
10
|
+
### Changed
|
11
|
+
|
12
|
+
- Version dependency of mdl, rest-client and rubocop
|
13
|
+
- Actual year of copyright to be dynamic
|
14
|
+
- API POST request read timeout from default of 60s to 600s
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
- New command called rebuild in order to rebuild an app image from the git repo
|
19
|
+
- Rescue read timeout from API request
|
20
|
+
|
21
|
+
### Fixed
|
22
|
+
|
23
|
+
- Error message when restarting a not yet deployed app by deprecating error_text usage
|
24
|
+
|
8
25
|
## 0.6.2 - 2019-08-24
|
9
26
|
|
10
27
|
### Fixed
|
data/exe/gleis
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'gleis/main'
|
4
4
|
|
5
|
-
puts "\n### Gleis CLI Copyright (c) 2018
|
5
|
+
puts "\n### Gleis CLI Copyright (c) 2018-#{Time.new.year} towards GmbH - v#{Gleis::VERSION} - https://gleis.cloud ###\n\n" \
|
6
6
|
unless ARGF.argv.include?('-q')
|
7
7
|
|
8
8
|
trap 'SIGINT' do
|
data/lib/gleis/api.rb
CHANGED
@@ -12,14 +12,14 @@ module Gleis
|
|
12
12
|
resp = RestClient.send(method, url, 'X-Gleis-Token': token, content_type: :json, accept: :json,
|
13
13
|
user_agent: user_agent)
|
14
14
|
when 'post', 'put'
|
15
|
-
if token
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
resp = if token
|
16
|
+
RestClient::Request.execute(method: method.to_s, url: url, payload: body.to_json, read_timeout: 600,
|
17
|
+
headers: { 'X-Gleis-Token': token, 'Content-Type': 'application/json',
|
18
|
+
'Accept': 'application/json', 'User-Agent': user_agent })
|
19
|
+
else
|
20
|
+
RestClient.send(method, url, body.to_json, content_type: :json, accept: :json,
|
21
21
|
user_agent: user_agent)
|
22
|
-
|
22
|
+
end
|
23
23
|
when 'stream'
|
24
24
|
stream_output = proc { |response|
|
25
25
|
response.read_body do |chunk|
|
@@ -44,6 +44,8 @@ module Gleis
|
|
44
44
|
abort('Application not found.')
|
45
45
|
rescue RestClient::InternalServerError
|
46
46
|
abort('An error occured on the platform. Please contact support if this problem persists.')
|
47
|
+
rescue RestClient::Exceptions::ReadTimeout
|
48
|
+
abort('The request timed out reading data from the platform.')
|
47
49
|
rescue StandardError # (e.g. SocketError, Errno::ECONNREFUSED, RestClient::BadGateway, ...)
|
48
50
|
abort('There was an issue connecting to the Gleis API server.')
|
49
51
|
else
|
data/lib/gleis/application.rb
CHANGED
@@ -145,13 +145,25 @@ module Gleis
|
|
145
145
|
end
|
146
146
|
end
|
147
147
|
|
148
|
+
def self.rebuild(app_name)
|
149
|
+
token = Token.check
|
150
|
+
puts 'Please wait while rebuilding, it could take a few minutes depending on app dependencies and complexity...'
|
151
|
+
body = API.request('post', 'rebuild', token, 'name': app_name)
|
152
|
+
if body['success'] == 1
|
153
|
+
puts "\nSuccessfully rebuilt app from git repo, detailed output from image build below:"
|
154
|
+
puts body['data']
|
155
|
+
else
|
156
|
+
puts 'Failed to rebuild app: ' + body['message']
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
148
160
|
def self.restart(app_name)
|
149
161
|
token = Token.check
|
150
162
|
body = API.request('post', 'restart', token, 'name': app_name)
|
151
163
|
if body['success'] == 1
|
152
164
|
puts 'Successfully restarted app using rolling update'
|
153
165
|
else
|
154
|
-
puts 'Failed to restart app: ' + body['
|
166
|
+
puts 'Failed to restart app: ' + body['message']
|
155
167
|
end
|
156
168
|
end
|
157
169
|
|
data/lib/gleis/cli/app.rb
CHANGED
@@ -62,6 +62,11 @@ module Gleis
|
|
62
62
|
Application.ps(options[:app])
|
63
63
|
end
|
64
64
|
|
65
|
+
desc 'rebuild', 'Rebuild app from git repo'
|
66
|
+
def rebuild
|
67
|
+
Application.rebuild(options[:app])
|
68
|
+
end
|
69
|
+
|
65
70
|
desc 'restart', 'Restart application (rolling update)'
|
66
71
|
def restart
|
67
72
|
Application.restart(options[:app])
|
data/lib/gleis/config.rb
CHANGED
@@ -9,7 +9,7 @@ module Gleis
|
|
9
9
|
|
10
10
|
def self.get_env_vars(app_name, token)
|
11
11
|
body = API.request('get', "config/#{app_name}", token)
|
12
|
-
abort("Failed to get app environment variables: #{body['
|
12
|
+
abort("Failed to get app environment variables: #{body['message']}") if body['success'] != 1
|
13
13
|
body
|
14
14
|
end
|
15
15
|
|
data/lib/gleis/management.rb
CHANGED
@@ -21,7 +21,7 @@ module Gleis
|
|
21
21
|
def self.license
|
22
22
|
puts <<LICENSE
|
23
23
|
Gleis Command Line Interface for the Gleis Platform as a Service
|
24
|
-
Copyright (C) 2018
|
24
|
+
Copyright (C) 2018-#{Time.new.year} towards GmbH
|
25
25
|
|
26
26
|
This program is free software: you can redistribute it and/or modify
|
27
27
|
it under the terms of the GNU General Public License as published by
|
data/lib/gleis/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gleis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc Bigler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.8'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
54
|
+
version: '0.8'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,28 +86,28 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.68.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.68.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rest-client
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.
|
103
|
+
version: 2.1.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 2.
|
110
|
+
version: 2.1.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: thor
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|