strata-cli 0.1.13 → 0.1.14
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 +11 -0
- data/lib/strata/cli/configuration.rb +2 -0
- data/lib/strata/cli/descriptions/tutorial.txt +13 -0
- data/lib/strata/cli/generators/tutorial.rb +72 -0
- data/lib/strata/cli/guard.rb +1 -0
- data/lib/strata/cli/main.rb +8 -0
- data/lib/strata/cli/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b0fdc6cf6a28080152c9b0237d54e206740477d196178a2e6d5aa5642720135
|
|
4
|
+
data.tar.gz: d049c71dd05982f8a52b786ae59ffdf590056dc3bdb5cadd7045227dbe9de867
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f7c7aa4945d149bff16578ca52f99a005b3c9d4c3b5897b52929bf9bfffb140883457f60d52552fa551faee5ef6d0472069c368125653bf784078378a7065dbe
|
|
7
|
+
data.tar.gz: 48a81467d16e8b489bdce4f177dd1b158ac09344c07d1944d804a679afc0ed47e52047b6a478781ba245c291a4d9bb8512f8159b1d09ecf41e1f537b5873e52b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.1.14] - 2026-07-17
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Tutorial command**: `strata tutorial` walks new users through a guided setup — initializes a project, configures a datasource, and deploys to a local Strata server running on port 8080.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Tutorial deployment**: Completion message now includes `--skip-audit` flag in the deployment instructions.
|
|
12
|
+
- **Tutorial server config**: Default server port set to 8080 (was 3000).
|
|
13
|
+
|
|
3
14
|
## [0.1.13] - 2026-06-20
|
|
4
15
|
|
|
5
16
|
### Changed
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Sets up the Strata tutorial project locally by cloning the tutorial repo,
|
|
2
|
+
wiring it to your Strata instance, and preparing it for `strata deploy`.
|
|
3
|
+
|
|
4
|
+
The --api-key value is shown on the tutorial setup page
|
|
5
|
+
in your Strata instance. Copy-paste them directly from there.
|
|
6
|
+
|
|
7
|
+
After running this command, `cd` into the project directory and run
|
|
8
|
+
`strata deploy` to deploy the tutorial to your Strata instance.
|
|
9
|
+
|
|
10
|
+
Example:
|
|
11
|
+
strata tutorial -a your_api_key
|
|
12
|
+
cd tutorial
|
|
13
|
+
strata deploy
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "group"
|
|
4
|
+
require_relative "../helpers/project_helper"
|
|
5
|
+
require_relative "../output"
|
|
6
|
+
require "yaml"
|
|
7
|
+
require "fileutils"
|
|
8
|
+
|
|
9
|
+
module Strata
|
|
10
|
+
module CLI
|
|
11
|
+
module Generators
|
|
12
|
+
class Tutorial < Group
|
|
13
|
+
TUTORIAL_REPO = "https://github.com/stratasite/strata-tutorial-project"
|
|
14
|
+
DEFAULT_SERVER = "http://localhost:8080"
|
|
15
|
+
TUTORIAL_PROJECT = "strata-tutorial-project"
|
|
16
|
+
|
|
17
|
+
class_option :api_key, aliases: ["a"], type: :string, desc: "Strata API key"
|
|
18
|
+
|
|
19
|
+
desc "Sets up the Strata tutorial project locally."
|
|
20
|
+
|
|
21
|
+
def validate_options
|
|
22
|
+
raise Strata::CommandError, "--api-key (-a) is required." unless options[:api_key]
|
|
23
|
+
@uid = TUTORIAL_PROJECT
|
|
24
|
+
@project_id = 1
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def clone_tutorial_repo
|
|
28
|
+
if File.directory?(@uid)
|
|
29
|
+
Output.print_status(:skip, "Directory '#{@uid}' already exists — re-using it", type: :info, context: self)
|
|
30
|
+
return
|
|
31
|
+
end
|
|
32
|
+
Output.print_status(:clone, "Cloning tutorial from #{TUTORIAL_REPO}", type: :success, context: self)
|
|
33
|
+
run "git clone #{TUTORIAL_REPO} #{@uid}", verbose: false, capture: true
|
|
34
|
+
raise Strata::CommandError, "Failed to clone tutorial repo." unless File.directory?(@uid)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def reinitialize_git
|
|
38
|
+
inside @uid do
|
|
39
|
+
FileUtils.rm_rf(".git")
|
|
40
|
+
run "git init -b main", verbose: false, capture: true
|
|
41
|
+
create_file ".gitignore", ".strata\n.strata_cli/\n", force: true
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def write_strata_config
|
|
46
|
+
strata_path = File.join(@uid, ".strata")
|
|
47
|
+
File.write(strata_path, "api_key: #{options[:api_key]}\nserver: #{DEFAULT_SERVER}\n")
|
|
48
|
+
File.chmod(0o600, strata_path)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def update_project_yml
|
|
52
|
+
project_yml = File.join(@uid, "project.yml")
|
|
53
|
+
return unless File.exist?(project_yml)
|
|
54
|
+
|
|
55
|
+
Helpers::ProjectHelper.persist_project_id_to_yml(@project_id, project_yml_path: project_yml)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def initial_commit
|
|
59
|
+
inside @uid do
|
|
60
|
+
run "git add -A", verbose: false, capture: true
|
|
61
|
+
run 'git commit -m "Initial tutorial project setup"', verbose: false, capture: true
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def completion_message
|
|
66
|
+
Output.print_success("\n✔ Tutorial project '#{@uid}' is ready!\n", context: self)
|
|
67
|
+
Output.print_info(" Next: cd #{@uid} && strata deploy --skip-audit\n", context: self)
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
data/lib/strata/cli/guard.rb
CHANGED
data/lib/strata/cli/main.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "generators/project"
|
|
4
|
+
require_relative "generators/tutorial"
|
|
4
5
|
require_relative "sub_commands/datasource"
|
|
5
6
|
require_relative "sub_commands/deploy"
|
|
6
7
|
require_relative "sub_commands/branch"
|
|
@@ -47,6 +48,13 @@ module Strata
|
|
|
47
48
|
invoke Generators::Project, [project_name], options
|
|
48
49
|
end
|
|
49
50
|
|
|
51
|
+
desc "tutorial", "Set up the Strata TPC-DS tutorial project"
|
|
52
|
+
long_desc_from_file "tutorial"
|
|
53
|
+
option :api_key, aliases: ["a"], type: :string, desc: "Strata API key"
|
|
54
|
+
def tutorial
|
|
55
|
+
invoke Generators::Tutorial, [], options
|
|
56
|
+
end
|
|
57
|
+
|
|
50
58
|
desc "adapters", "Lists supported data warehouse adapters"
|
|
51
59
|
def adapters
|
|
52
60
|
out = " SUPPORTED ADAPTERS: \n\t#{DWH.adapters.keys.join("\n\t")}"
|
data/lib/strata/cli/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: strata-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ajo Abraham
|
|
@@ -264,6 +264,7 @@ files:
|
|
|
264
264
|
- lib/strata/cli/descriptions/deploy/deploy.txt
|
|
265
265
|
- lib/strata/cli/descriptions/deploy/status.txt
|
|
266
266
|
- lib/strata/cli/descriptions/init.txt
|
|
267
|
+
- lib/strata/cli/descriptions/tutorial.txt
|
|
267
268
|
- lib/strata/cli/error_reporter.rb
|
|
268
269
|
- lib/strata/cli/generators/datasource.rb
|
|
269
270
|
- lib/strata/cli/generators/group.rb
|
|
@@ -292,6 +293,7 @@ files:
|
|
|
292
293
|
- lib/strata/cli/generators/templates/table.table_name.yml
|
|
293
294
|
- lib/strata/cli/generators/templates/test.yml
|
|
294
295
|
- lib/strata/cli/generators/test.rb
|
|
296
|
+
- lib/strata/cli/generators/tutorial.rb
|
|
295
297
|
- lib/strata/cli/guard.rb
|
|
296
298
|
- lib/strata/cli/helpers/command_context.rb
|
|
297
299
|
- lib/strata/cli/helpers/datasource_helper.rb
|