-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update README.md for 0.2.0 things to. verify: - [ ] how to upgrade rill developer - [ ] * Adding example project command to cli * Adding README.md to .prettierignore Co-authored-by: Aditya Hegde <[email protected]>
- Loading branch information
1 parent
3ce5db3
commit a723964
Showing
10 changed files
with
117 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ log | |
.prettierignore | ||
Dockerfile | ||
Duckdb-Dockerfile | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { DataModelerCliCommand } from "$cli/DataModelerCliCommand"; | ||
import { Command } from "commander"; | ||
import { execSync } from "node:child_process"; | ||
import { ImportTableCommand } from "$cli/ImportTableCommand"; | ||
import { InitCommand } from "$cli/InitCommand"; | ||
import { StartCommand } from "$cli/StartCommand"; | ||
import { ExpressServer } from "$server/ExpressServer"; | ||
|
||
export class ExampleProjectCommand extends DataModelerCliCommand { | ||
public getCommand(): Command { | ||
return this.applyCommonSettings( | ||
new Command("initialize-example-project"), | ||
"Initialize example project." | ||
).action((opts, command: Command) => { | ||
let { project } = command.optsWithGlobals(); | ||
if (!project) project = process.cwd() + "/rill-developer-example"; | ||
|
||
return this.createExampleProject(project); | ||
}); | ||
} | ||
|
||
protected async sendActions(): Promise<void> { | ||
// no-op | ||
} | ||
|
||
public async createExampleProject(project: string): Promise<void> { | ||
console.log(`Initializing the project example project ${project} ...`); | ||
await new InitCommand().createProjectAndRun({}, project); | ||
|
||
console.log("Downloading dataset for example project..."); | ||
execSync( | ||
`curl -s http://pkg.rilldata.com/rill-developer-example/data/flightlist.zip ` + | ||
`--output ${project}/flightlist.zip`, | ||
{ stdio: "inherit" } | ||
); | ||
execSync(`unzip ${project}/flightlist.zip ` + `-d ${project}/`, { | ||
stdio: "inherit", | ||
}); | ||
|
||
console.log("Importing example dataset into the project..."); | ||
await new ImportTableCommand().run( | ||
{ | ||
projectPath: project, | ||
}, | ||
`${project}/data/flightlist_2022_02.csv`, | ||
{} | ||
); | ||
|
||
return new StartCommand().run({ | ||
projectPath: project, | ||
shouldInitState: false, | ||
shouldSkipDatabase: false, | ||
profileWithUpdate: true, | ||
}); | ||
} | ||
|
||
protected async teardown(): Promise<void> { | ||
// do not teardown as this will have a perpetual server | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters