gazer 0.2.47 → 0.2.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/scripts/wait_for_looker.sh +35 -0
- data/.github/workflows/release.yml +45 -0
- data/.github/workflows/ruby-ci.yml +60 -0
- data/CHANGELOG.md +15 -0
- data/Gemfile +1 -4
- data/Gemfile.lock +29 -96
- data/README.md +1 -2
- data/gzr.gemspec +7 -8
- data/lib/gzr/cli.rb +0 -1
- data/lib/gzr/modules/session.rb +39 -11
- data/lib/gzr/version.rb +1 -1
- metadata +21 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0089f5a63cbc66ea6af8d6a096a88ebc6a8ff8efa905ee915d7295f4eb9a5cca'
|
4
|
+
data.tar.gz: 1b6a3851ac1525597895d1d20004453c7cdad79b7e06d81a077b0902df6faee8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b493b5b1c37e2f1647df0a3ee6fb7d776f895ded99e42c50a3dac839c7538ab3c321f944985c7d41d26d078d0cc16a0f6e2b756d9bec0802213a56e7ea718d90
|
7
|
+
data.tar.gz: a706677249275c2b6e47f7237b2c89a64dd7257405959ce6433bcd47a63d25348fc892ebde2a29321426bfe479c6cda13f2397c1925daa9deb76c9a0569d2860
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
check_looker() {
|
4
|
+
status=$(curl --silent --insecure --write "%{http_code}" \
|
5
|
+
--data "client_id=$LOOKERSDK_CLIENT_ID&client_secret=$LOOKERSDK_CLIENT_SECRET"\
|
6
|
+
$LOOKERSDK_BASE_URL/api/${LOOKERSDK_API_VERSION:-4.0}/login\
|
7
|
+
-o /dev/null)
|
8
|
+
}
|
9
|
+
|
10
|
+
MAX_RETRIES=160
|
11
|
+
ATTEMPTS=1
|
12
|
+
status=0
|
13
|
+
check_looker
|
14
|
+
while [ $status -ne 200 ];
|
15
|
+
do
|
16
|
+
RETRY_MSG="after $ATTEMPTS attempts: $MAX_RETRIES retries remaining."
|
17
|
+
if [ $ATTEMPTS -ge $MAX_RETRIES ];
|
18
|
+
then
|
19
|
+
echo 'Looker took too long to start'
|
20
|
+
exit 1
|
21
|
+
else
|
22
|
+
if [ $status -ne 0 ];
|
23
|
+
then
|
24
|
+
echo "Received status($status) from Looker $RETRY_MSG"
|
25
|
+
else
|
26
|
+
echo "Looker server connection rejected $RETRY_MSG"
|
27
|
+
fi
|
28
|
+
fi
|
29
|
+
|
30
|
+
sleep 2
|
31
|
+
ATTEMPTS=$(( $ATTEMPTS + 1 ))
|
32
|
+
check_looker
|
33
|
+
done
|
34
|
+
echo "Looker ready after $ATTEMPTS attempts"
|
35
|
+
exit 0
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# .github/workflows/release.yml
|
2
|
+
|
3
|
+
name: release
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- main
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
release-please:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- uses: GoogleCloudPlatform/release-please-action@v2
|
15
|
+
id: release
|
16
|
+
with:
|
17
|
+
release-type: ruby
|
18
|
+
package-name: gazer
|
19
|
+
bump-minor-pre-major: true
|
20
|
+
version-file: "lib/gzr/version.rb"
|
21
|
+
# Checkout code if release was created
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
if: ${{ steps.release.outputs.release_created }}
|
24
|
+
# Setup ruby if a release was created
|
25
|
+
- uses: ruby/setup-ruby@v1
|
26
|
+
with:
|
27
|
+
ruby-version: 2.5.8
|
28
|
+
if: ${{ steps.release.outputs.release_created }}
|
29
|
+
# Bundle install
|
30
|
+
- run: bundle install
|
31
|
+
if: ${{ steps.release.outputs.release_created }}
|
32
|
+
# Publish
|
33
|
+
- name: publish gem
|
34
|
+
run: |
|
35
|
+
mkdir -p $HOME/.gem
|
36
|
+
touch $HOME/.gem/credentials
|
37
|
+
chmod 0600 $HOME/.gem/credentials
|
38
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
39
|
+
gem build *.gemspec
|
40
|
+
gem push *.gem
|
41
|
+
env:
|
42
|
+
# Make sure to update the secret name
|
43
|
+
# if yours isn't named RUBYGEMS_AUTH_TOKEN
|
44
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
|
45
|
+
if: ${{ steps.release.outputs.release_created }}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
name: Ruby-CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ main ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ main ]
|
8
|
+
|
9
|
+
env:
|
10
|
+
LOOKERSDK_BASE_URL: https://localhost:20000
|
11
|
+
LOOKERSDK_VERIFY_SSL: false
|
12
|
+
TS_JUNIT_OUTPUT_DIR: results/sdk-codegen
|
13
|
+
LOOKERSDK_CLIENT_ID: ${{ secrets.LOOKERSDK_CLIENT_ID__21_18 }}
|
14
|
+
LOOKERSDK_CLIENT_SECRET: ${{ secrets.LOOKERSDK_CLIENT_SECRET__21_18 }}
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
strategy:
|
21
|
+
matrix:
|
22
|
+
ruby-version: [2.5.8]
|
23
|
+
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v2
|
26
|
+
|
27
|
+
- name: Set up Cloud SDK
|
28
|
+
uses: google-github-actions/setup-gcloud@v0.2.0
|
29
|
+
with:
|
30
|
+
project_id: ${{ secrets.GCP_PROJECT_ID }}
|
31
|
+
service_account_key: ${{ secrets.GCP_AR_READER_SA_KEY }}
|
32
|
+
export_default_credentials: true
|
33
|
+
|
34
|
+
- name: Authenticate Artifact Repository
|
35
|
+
run: gcloud auth configure-docker us-west1-docker.pkg.dev --quiet
|
36
|
+
|
37
|
+
- name: Pull and run Looker docker image
|
38
|
+
# TODO: can we cache some layers of the image for faster download?
|
39
|
+
# we probably don't want to cache the final image for IP security...
|
40
|
+
run: |
|
41
|
+
docker pull --quiet us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_18
|
42
|
+
# set $LOOKER_OPTS to --no-ssl if we want to turn off ssl
|
43
|
+
docker run --name looker-sdk-codegen-ci -d -p 10000:9999 -p 20000:19999 us-west1-docker.pkg.dev/cloud-looker-sdk-codegen-cicd/looker/21_20
|
44
|
+
docker logs -f looker-sdk-codegen-ci --until=30s &
|
45
|
+
|
46
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
47
|
+
uses: ruby/setup-ruby@v1
|
48
|
+
with:
|
49
|
+
ruby-version: ${{ matrix.ruby-version }}
|
50
|
+
bundler-cache: true
|
51
|
+
|
52
|
+
- name: Install dependencies
|
53
|
+
run: bundle install
|
54
|
+
|
55
|
+
- name: Check that Looker is ready
|
56
|
+
run: |
|
57
|
+
${{ github.workspace }}/.github/scripts/wait_for_looker.sh
|
58
|
+
|
59
|
+
- name: Run tests
|
60
|
+
run: bundle exec rake
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
### [0.2.49](https://www.github.com/looker-open-source/gzr/compare/v0.2.48...v0.2.49) (2021-11-18)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* Bump version ([652486c](https://www.github.com/looker-open-source/gzr/commit/652486ce6571d4fea2d3ea847c5927395aa4373e))
|
9
|
+
|
10
|
+
### [0.2.48](https://www.github.com/looker-open-source/gzr/compare/v0.2.47...v0.2.48) (2021-11-18)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* Add release please workflow to automate releases ([6279bc6](https://www.github.com/looker-open-source/gzr/commit/6279bc68fcfd8f09f7385053767e6a9571570333))
|
data/Gemfile
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
|
22
22
|
RUBY_VERSION = File.read(File.join(File.dirname(__FILE__), '.ruby-version')).split('-').last.chomp
|
23
23
|
|
24
|
-
ruby '2.5.8', engine: 'ruby', engine_version:
|
24
|
+
ruby '2.5.8', engine: 'ruby', engine_version: '2.5.8'
|
25
25
|
|
26
26
|
source "https://rubygems.org"
|
27
27
|
|
@@ -29,7 +29,4 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
|
29
29
|
|
30
30
|
# Specify your gem's dependencies in gzr.gemspec
|
31
31
|
gemspec
|
32
|
-
#gem 'looker-sdk', :git => 'git@github.com:looker/looker-sdk-ruby.git'
|
33
|
-
#gem 'tty', :git => 'git@github.com:piotrmurach/tty.git'
|
34
|
-
#gem 'tty-file', :git => 'git@github.com:piotrmurach/tty-file.git'
|
35
32
|
|
data/Gemfile.lock
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gazer (0.2.
|
4
|
+
gazer (0.2.48)
|
5
5
|
looker-sdk (~> 0.1.1)
|
6
6
|
net-http-persistent (~> 4.0.1)
|
7
7
|
netrc (~> 0.11.0)
|
8
|
-
pastel (~> 0.
|
8
|
+
pastel (~> 0.8.0)
|
9
9
|
rubyzip (~> 1.3.0)
|
10
|
-
thor (~>
|
11
|
-
tty-reader (~> 0.
|
12
|
-
tty-table (~> 0.
|
13
|
-
tty-tree (~> 0.
|
10
|
+
thor (~> 1.1.0)
|
11
|
+
tty-reader (~> 0.9.0)
|
12
|
+
tty-table (~> 0.12.0)
|
13
|
+
tty-tree (~> 0.4.0)
|
14
14
|
|
15
15
|
GEM
|
16
16
|
remote: https://rubygems.org/
|
@@ -18,8 +18,7 @@ GEM
|
|
18
18
|
addressable (2.8.0)
|
19
19
|
public_suffix (>= 2.0.2, < 5.0)
|
20
20
|
connection_pool (2.2.5)
|
21
|
-
diff-lcs (1.
|
22
|
-
equatable (0.5.0)
|
21
|
+
diff-lcs (1.4.4)
|
23
22
|
faraday (1.8.0)
|
24
23
|
faraday-em_http (~> 1.0)
|
25
24
|
faraday-em_synchrony (~> 1.0)
|
@@ -39,21 +38,17 @@ GEM
|
|
39
38
|
faraday-net_http_persistent (1.2.0)
|
40
39
|
faraday-patron (1.0.0)
|
41
40
|
faraday-rack (1.0.0)
|
42
|
-
kramdown (1.16.2)
|
43
41
|
looker-sdk (0.1.1)
|
44
42
|
faraday (>= 1.2, < 2.0)
|
45
43
|
sawyer (~> 0.8)
|
46
44
|
multipart-post (2.1.1)
|
47
|
-
necromancer (0.4.0)
|
48
45
|
net-http-persistent (4.0.1)
|
49
46
|
connection_pool (~> 2.2)
|
50
47
|
netrc (0.11.0)
|
51
|
-
pastel (0.
|
52
|
-
|
53
|
-
tty-color (~> 0.4.0)
|
48
|
+
pastel (0.8.0)
|
49
|
+
tty-color (~> 0.5)
|
54
50
|
public_suffix (4.0.6)
|
55
51
|
rake (12.3.3)
|
56
|
-
rouge (3.1.1)
|
57
52
|
rspec (3.10.0)
|
58
53
|
rspec-core (~> 3.10.0)
|
59
54
|
rspec-expectations (~> 3.10.0)
|
@@ -72,101 +67,39 @@ GEM
|
|
72
67
|
sawyer (0.8.2)
|
73
68
|
addressable (>= 2.3.5)
|
74
69
|
faraday (> 0.8, < 2.0)
|
75
|
-
strings (0.1
|
76
|
-
strings-ansi (~> 0.
|
77
|
-
unicode-display_width (
|
70
|
+
strings (0.2.1)
|
71
|
+
strings-ansi (~> 0.2)
|
72
|
+
unicode-display_width (>= 1.5, < 3.0)
|
78
73
|
unicode_utils (~> 1.4)
|
79
74
|
strings-ansi (0.2.0)
|
80
|
-
thor (
|
81
|
-
|
82
|
-
tty (0.
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
tty-
|
92
|
-
|
93
|
-
|
94
|
-
tty-markdown (~> 0.4.0)
|
95
|
-
tty-pager (~> 0.11.0)
|
96
|
-
tty-platform (~> 0.1.0)
|
97
|
-
tty-progressbar (~> 0.15.0)
|
98
|
-
tty-prompt (~> 0.16.1)
|
99
|
-
tty-screen (~> 0.6.4)
|
100
|
-
tty-spinner (~> 0.8.0)
|
101
|
-
tty-table (~> 0.10.0)
|
102
|
-
tty-tree (~> 0.1.0)
|
103
|
-
tty-which (~> 0.3.0)
|
104
|
-
tty-color (0.4.3)
|
105
|
-
tty-command (0.8.2)
|
106
|
-
pastel (~> 0.7.0)
|
107
|
-
tty-config (0.2.0)
|
108
|
-
tty-cursor (0.5.0)
|
109
|
-
tty-editor (0.4.0)
|
110
|
-
tty-prompt (~> 0.16.0)
|
111
|
-
tty-which (~> 0.3.0)
|
112
|
-
tty-file (0.6.0)
|
113
|
-
diff-lcs (~> 1.3.0)
|
114
|
-
pastel (~> 0.7.2)
|
115
|
-
tty-prompt (~> 0.16.1)
|
116
|
-
tty-font (0.2.0)
|
117
|
-
tty-markdown (0.4.0)
|
118
|
-
kramdown (~> 1.16.2)
|
119
|
-
pastel (~> 0.7.2)
|
120
|
-
rouge (~> 3.1.0)
|
121
|
-
strings (~> 0.1.0)
|
122
|
-
tty-color (~> 0.4.2)
|
123
|
-
tty-screen (~> 0.6.4)
|
124
|
-
tty-pager (0.11.0)
|
125
|
-
strings (~> 0.1.0)
|
126
|
-
tty-screen (~> 0.6.4)
|
127
|
-
tty-which (~> 0.3.0)
|
128
|
-
tty-platform (0.1.0)
|
129
|
-
tty-progressbar (0.15.1)
|
130
|
-
tty-cursor (~> 0.5.0)
|
131
|
-
tty-screen (~> 0.6.4)
|
132
|
-
unicode-display_width (~> 1.3)
|
133
|
-
tty-prompt (0.16.1)
|
134
|
-
necromancer (~> 0.4.0)
|
135
|
-
pastel (~> 0.7.0)
|
136
|
-
timers (~> 4.0)
|
137
|
-
tty-cursor (~> 0.5.0)
|
138
|
-
tty-reader (~> 0.3.0)
|
139
|
-
tty-reader (0.3.0)
|
140
|
-
tty-cursor (~> 0.5.0)
|
141
|
-
tty-screen (~> 0.6.4)
|
142
|
-
wisper (~> 2.0.0)
|
143
|
-
tty-screen (0.6.5)
|
144
|
-
tty-spinner (0.8.0)
|
145
|
-
tty-cursor (>= 0.5.0)
|
146
|
-
tty-table (0.10.0)
|
147
|
-
equatable (~> 0.5.0)
|
148
|
-
necromancer (~> 0.4.0)
|
149
|
-
pastel (~> 0.7.2)
|
150
|
-
strings (~> 0.1.0)
|
151
|
-
tty-screen (~> 0.6.4)
|
152
|
-
tty-tree (0.1.0)
|
153
|
-
tty-which (0.3.0)
|
154
|
-
unicode-display_width (1.8.0)
|
75
|
+
thor (1.1.0)
|
76
|
+
tty-color (0.6.0)
|
77
|
+
tty-cursor (0.7.1)
|
78
|
+
tty-reader (0.9.0)
|
79
|
+
tty-cursor (~> 0.7)
|
80
|
+
tty-screen (~> 0.8)
|
81
|
+
wisper (~> 2.0)
|
82
|
+
tty-screen (0.8.1)
|
83
|
+
tty-table (0.12.0)
|
84
|
+
pastel (~> 0.8)
|
85
|
+
strings (~> 0.2.0)
|
86
|
+
tty-screen (~> 0.8)
|
87
|
+
tty-tree (0.4.0)
|
88
|
+
unicode-display_width (2.1.0)
|
155
89
|
unicode_utils (1.4.0)
|
156
90
|
wisper (2.0.1)
|
157
91
|
|
158
92
|
PLATFORMS
|
159
|
-
|
93
|
+
x86_64-linux
|
160
94
|
|
161
95
|
DEPENDENCIES
|
162
|
-
bundler (
|
96
|
+
bundler (>= 2.2.10)
|
163
97
|
gazer!
|
164
98
|
rake (~> 12.3.3)
|
165
99
|
rspec (~> 3.0)
|
166
|
-
tty (~> 0.8)
|
167
100
|
|
168
101
|
RUBY VERSION
|
169
102
|
ruby 2.5.8p224
|
170
103
|
|
171
104
|
BUNDLED WITH
|
172
|
-
|
105
|
+
2.2.30
|
data/README.md
CHANGED
@@ -5,8 +5,7 @@ and Dashboards via a simple command line tool.
|
|
5
5
|
|
6
6
|
## Status and Support
|
7
7
|
|
8
|
-
|
9
|
-
for issues with Gazer. Issues can be logged via https://github.com/looker-open-source/gzr/issues
|
8
|
+
As of November 2021, Looker Deployer is supported, but not warrantied by Bytecode IO, Inc. Issues and feature requests can be reported via https://github.com/llooker/looker_deployer/issues, which will be regularly monitored and prioritized by Bytecode IO, Inc., a preferred Looker consulting partner.
|
10
9
|
|
11
10
|
## Installation
|
12
11
|
|
data/gzr.gemspec
CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.license = "MIT"
|
29
29
|
spec.version = Gzr::VERSION
|
30
30
|
spec.authors = ["Mike DeAngelo"]
|
31
|
-
spec.email = ["
|
31
|
+
spec.email = ["drstrangelove@google.com"]
|
32
32
|
|
33
33
|
spec.summary = %q{Command line tool to manage the content of a Looker instance.}
|
34
34
|
spec.description = %q{Command line tool to manage the content of a Looker instance.}
|
@@ -52,18 +52,17 @@ Gem::Specification.new do |spec|
|
|
52
52
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
53
53
|
spec.require_paths = ["lib"]
|
54
54
|
|
55
|
-
spec.add_dependency "tty-reader", "~> 0.
|
56
|
-
spec.add_dependency "tty-table", "~> 0.
|
57
|
-
spec.add_dependency "tty-tree", "~> 0.
|
58
|
-
spec.add_dependency "pastel", "~> 0.
|
59
|
-
spec.add_dependency "thor", "~>
|
55
|
+
spec.add_dependency "tty-reader", "~> 0.9.0"
|
56
|
+
spec.add_dependency "tty-table", "~> 0.12.0"
|
57
|
+
spec.add_dependency "tty-tree", "~> 0.4.0"
|
58
|
+
spec.add_dependency "pastel", "~> 0.8.0"
|
59
|
+
spec.add_dependency "thor", "~> 1.1.0"
|
60
60
|
spec.add_dependency 'netrc', "~> 0.11.0"
|
61
61
|
spec.add_dependency 'rubyzip', "~> 1.3.0"
|
62
62
|
spec.add_dependency 'looker-sdk', "~> 0.1.1"
|
63
63
|
spec.add_dependency 'net-http-persistent', '~> 4.0.1'
|
64
64
|
|
65
|
-
spec.add_development_dependency "bundler", "
|
65
|
+
spec.add_development_dependency "bundler", ">= 2.2.10"
|
66
66
|
spec.add_development_dependency "rake", "~> 12.3.3"
|
67
67
|
spec.add_development_dependency "rspec", "~> 3.0"
|
68
|
-
spec.add_development_dependency "tty", "~> 0.8"
|
69
68
|
end
|
data/lib/gzr/cli.rb
CHANGED
@@ -44,7 +44,6 @@ module Gzr
|
|
44
44
|
class_option :width, type: :numeric, default: nil, desc: 'Width of rendering for tables'
|
45
45
|
class_option :persistent, type: :boolean, default: false, desc: 'Use persistent connection to communicate with host'
|
46
46
|
|
47
|
-
|
48
47
|
# Error raised by this runner
|
49
48
|
Error = Class.new(StandardError)
|
50
49
|
|
data/lib/gzr/modules/session.rb
CHANGED
@@ -74,7 +74,8 @@ module Gzr
|
|
74
74
|
}
|
75
75
|
else
|
76
76
|
conn_hash[:connection_options][:ssl] = {
|
77
|
-
:verify => false
|
77
|
+
:verify => false,
|
78
|
+
:verify_mode => (OpenSSL::SSL::VERIFY_NONE)
|
78
79
|
}
|
79
80
|
end
|
80
81
|
end
|
@@ -101,15 +102,33 @@ module Gzr
|
|
101
102
|
conn_hash
|
102
103
|
end
|
103
104
|
|
104
|
-
def faraday_connection
|
105
|
-
@faraday_connection ||= Faraday.new { |conn|
|
106
|
-
if @options[:persistent]
|
107
|
-
conn.adapter :net_http_persistent
|
108
|
-
end
|
109
|
-
}
|
110
|
-
end
|
111
|
-
|
112
105
|
def login(min_api_version=nil)
|
106
|
+
if (@options[:client_id].nil? && ENV["LOOKERSDK_CLIENT_ID"])
|
107
|
+
@options[:client_id] = ENV["LOOKERSDK_CLIENT_ID"]
|
108
|
+
end
|
109
|
+
|
110
|
+
if (@options[:client_secret].nil? && ENV["LOOKERSDK_CLIENT_SECRET"])
|
111
|
+
@options[:client_secret] = ENV["LOOKERSDK_CLIENT_SECRET"]
|
112
|
+
end
|
113
|
+
|
114
|
+
if (@options[:api_version].nil? && ENV["LOOKERSDK_API_VERSION"])
|
115
|
+
@options[:api_version] = ENV["LOOKERSDK_API_VERSION"]
|
116
|
+
end
|
117
|
+
|
118
|
+
if (@options[:verify_ssl] && ENV["LOOKERSDK_VERIFY_SSL"])
|
119
|
+
@options[:verify_ssl] = !(/^f(alse)?$/i =~ ENV["LOOKERSDK_VERIFY_SSL"])
|
120
|
+
end
|
121
|
+
|
122
|
+
if ((@options[:host] == 'localhost') && ENV["LOOKERSDK_BASE_URL"])
|
123
|
+
base_url = ENV["LOOKERSDK_BASE_URL"]
|
124
|
+
@options[:ssl] = !!(/^https/ =~ base_url)
|
125
|
+
@options[:host] = /^https?:\/\/([^:\/]+)/.match(base_url)[1]
|
126
|
+
md = /:([0-9]+)\/?$/.match(base_url)
|
127
|
+
@options[:port] = md[1] if md
|
128
|
+
end
|
129
|
+
|
130
|
+
say_ok("using options #{@options.select { |k,v| k != 'client_secret' }.map { |k,v| "#{k}=>#{v}" }}") if @options[:debug]
|
131
|
+
|
113
132
|
@secret = nil
|
114
133
|
begin
|
115
134
|
conn_hash = build_connection_hash
|
@@ -117,7 +136,11 @@ module Gzr
|
|
117
136
|
sawyer_options = {
|
118
137
|
:links_parser => Sawyer::LinkParsers::Simple.new,
|
119
138
|
:serializer => LookerSDK::Client::Serializer.new(JSON),
|
120
|
-
:faraday => Faraday.new(conn_hash[:connection_options])
|
139
|
+
:faraday => Faraday.new(conn_hash[:connection_options]) do |conn|
|
140
|
+
if @options[:persistent]
|
141
|
+
conn.adapter :net_http_persistent
|
142
|
+
end
|
143
|
+
end
|
121
144
|
}
|
122
145
|
|
123
146
|
endpoint = conn_hash[:api_endpoint]
|
@@ -157,7 +180,12 @@ module Gzr
|
|
157
180
|
say_ok("connecting to #{conn_hash.map { |k,v| "#{k}=>#{(k == :client_secret) ? '*********' : v}" }}") if @options[:debug]
|
158
181
|
|
159
182
|
begin
|
160
|
-
|
183
|
+
faraday = Faraday.new(conn_hash[:connection_options]) do |conn|
|
184
|
+
if @options[:persistent]
|
185
|
+
conn.adapter :net_http_persistent
|
186
|
+
end
|
187
|
+
end
|
188
|
+
@sdk = LookerSDK::Client.new(conn_hash.merge(faraday: faraday)) unless @sdk
|
161
189
|
|
162
190
|
say_ok "check for connectivity: #{@sdk.alive?}" if @options[:debug]
|
163
191
|
say_ok "verify authentication: #{@sdk.authenticated?}" if @options[:debug]
|
data/lib/gzr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gazer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.48
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike DeAngelo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-reader
|
@@ -16,70 +16,70 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.9.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.9.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: tty-table
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.12.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.12.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: tty-tree
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.4.0
|
48
48
|
type: :runtime
|
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.4.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pastel
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.8.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.8.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: thor
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 1.1.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 1.1.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: netrc
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,16 +140,16 @@ dependencies:
|
|
140
140
|
name: bundler
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: 2.2.10
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - "
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: 2.2.10
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rake
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,32 +178,22 @@ dependencies:
|
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '3.0'
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: tty
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - "~>"
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '0.8'
|
188
|
-
type: :development
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - "~>"
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '0.8'
|
195
181
|
description: Command line tool to manage the content of a Looker instance.
|
196
182
|
email:
|
197
|
-
-
|
183
|
+
- drstrangelove@google.com
|
198
184
|
executables:
|
199
185
|
- gzr
|
200
186
|
extensions: []
|
201
187
|
extra_rdoc_files: []
|
202
188
|
files:
|
189
|
+
- ".github/scripts/wait_for_looker.sh"
|
190
|
+
- ".github/workflows/release.yml"
|
191
|
+
- ".github/workflows/ruby-ci.yml"
|
203
192
|
- ".gitignore"
|
204
193
|
- ".rspec"
|
205
194
|
- ".ruby-version"
|
206
195
|
- ".travis.yml"
|
196
|
+
- CHANGELOG.md
|
207
197
|
- CODE_OF_CONDUCT.md
|
208
198
|
- CONTRIBUTING.md
|
209
199
|
- Gemfile
|