@gooddata/code-cli 0.1.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.
- package/LICENSE +60 -0
- package/NOTICE.txt +12914 -0
- package/README.md +83 -0
- package/assets/gooddata-logo.svg +4 -0
- package/bin/gd +3 -0
- package/out/index.d.ts +1 -0
- package/out/index.js +20 -0
- package/out/index.js.LICENSE.txt +12294 -0
- package/out/index.js.map +1 -0
- package/package.json +29 -0
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/gooddata-logo.svg" alt="GoodData Logo" width="120px" height="120px"/>
|
|
3
|
+
</p>
|
|
4
|
+
<h1 align="center">GoodData CLI</h1>
|
|
5
|
+
|
|
6
|
+
> GoodData for VS Code and GoodData CLI are available for you to try out and provide feedback. Avoid using those in a production environment.
|
|
7
|
+
|
|
8
|
+
Manage your analytics as code. The solution consists of two components:
|
|
9
|
+
|
|
10
|
+
* [GoodData Visual Studio Code Extension](https://marketplace.visualstudio.com/items?itemName=GoodData.gooddata-vscode).
|
|
11
|
+
* [GoodData Command-line Interface](https://www.npmjs.com/package/@gooddata/code-cli).
|
|
12
|
+
|
|
13
|
+
Together these tools allow you to:
|
|
14
|
+
|
|
15
|
+
1. Retrieve analytical objects from a GoodData server.
|
|
16
|
+
1. Create or update analytical objects in Visual Studio Code.
|
|
17
|
+
1. Test analytical objects locally in Visual Studio Code.
|
|
18
|
+
1. Deploy analytical objects to a GoodData server of your choice.
|
|
19
|
+
|
|
20
|
+
The analytical objects you can work with include datasets, which form the logical data model, and metrics. Additionally, we have plans to incorporate support for visualizations in the near future.
|
|
21
|
+
|
|
22
|
+
With GoodData CLI you can:
|
|
23
|
+
|
|
24
|
+
* Initialize a new project.
|
|
25
|
+
* Clone existing analytical project from GoodData server.
|
|
26
|
+
* Validate the analytical project, for example, in CI pipelines.
|
|
27
|
+
* Deploy the analytical project to GoodData server.
|
|
28
|
+
|
|
29
|
+
## Prerequisites
|
|
30
|
+
|
|
31
|
+
Before getting started, ensure that you have:
|
|
32
|
+
|
|
33
|
+
* A running instance of GoodData. Ensure you have the following information on hand:
|
|
34
|
+
* [API access token](https://www.gooddata.com/developers/cloud-native/doc/cloud/manage-organization/user-token/).
|
|
35
|
+
* Workspace ID of a workspace you want to clone and edit.
|
|
36
|
+
* Data source ID of the data source the workspace is connected to
|
|
37
|
+
* [Node.js version 16.17 or newer installed](https://nodejs.org/).
|
|
38
|
+
|
|
39
|
+
## Install CLI
|
|
40
|
+
|
|
41
|
+
In terminal, run `npm i -g @gooddata/code-cli`.
|
|
42
|
+
You should have a new CLI command available, try running `gd -v` or `gd --help`.
|
|
43
|
+
|
|
44
|
+
## `gd init` command
|
|
45
|
+
|
|
46
|
+
Once the CLI is installed you are able to initialize your project locally.
|
|
47
|
+
|
|
48
|
+
**Steps:**
|
|
49
|
+
|
|
50
|
+
1. Open a terminal and navigate to a folder where you want to build and store your analytics.
|
|
51
|
+
1. To initialize your project, run `gd init` and follow the instructions to create a `gooddata.yaml` definition file.
|
|
52
|
+
1. Create a `.env` file in the same folder as `gooddata.yaml` and add an environmental variable that stores
|
|
53
|
+
your API access token. For example:`GD_API_TOKEN="fd6f9a71541856b4c9617f74a8576e131"`.
|
|
54
|
+
|
|
55
|
+
> Make sure you do not store the `.env` file in you version control system (like Git).
|
|
56
|
+
> For example, you can add the file to `.gitignore`.
|
|
57
|
+
|
|
58
|
+
## `gd clone` command
|
|
59
|
+
|
|
60
|
+
To clone your GoodData analytical environment to your local machine, run `gd clone`.
|
|
61
|
+
|
|
62
|
+
You should now have an `analytics` folder that contains your `datasets` and `metrics`.
|
|
63
|
+
|
|
64
|
+
## `gd validate` command
|
|
65
|
+
|
|
66
|
+
GoodData CLI can run validation on your project. This is useful if you want to set up CI/CD pipelines
|
|
67
|
+
and, for example, ensure the project is valid before merging a pull request.
|
|
68
|
+
|
|
69
|
+
GoodData CLI will validate that:
|
|
70
|
+
* syntax of the YAML files is correct;
|
|
71
|
+
* there are no missing or unsupported properties;
|
|
72
|
+
* references between dataset and metrics are valid; and
|
|
73
|
+
* references to the database tables and columns are valid.
|
|
74
|
+
|
|
75
|
+
To execute validation, run `gd validate`.
|
|
76
|
+
|
|
77
|
+
## `gd deploy` command
|
|
78
|
+
|
|
79
|
+
GoodData CLI can deploy your analytical project to the GoodData server defined in `gooddata.yaml` file.
|
|
80
|
+
|
|
81
|
+
To execute the deployment, run `gd deploy`.
|
|
82
|
+
|
|
83
|
+
Before deploying the project, GoodData CLI will also run validation, unless `--no-validate` argument was passed to the command.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="120" height="120" viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="120" height="120" rx="60" fill="#ED27B7"/>
|
|
3
|
+
<path d="M92.3439 70.0835C92.1111 60.1453 86.6249 52.2567 78.2492 49.1733V31.8762C76.1342 30.5243 73.8835 29.4066 71.5341 28.5473V65.7597C71.5341 73.1314 68.1143 76.4231 62.6183 76.4231C57.2679 76.4231 52.7923 72.3819 52.7923 65.624C52.7923 58.0811 58.6714 53.4746 66.3696 53.4746C67.0827 53.4616 67.8087 53.4988 68.5218 53.6102V47.0251C67.8087 46.9023 67.0956 46.841 66.3696 46.8539C54.9444 46.8539 45.9915 53.8573 45.9915 65.6385C45.9915 76.9658 54.0713 83.0099 63.0743 83.0099C67.3414 83.0099 71.0312 81.5594 73.5779 79.0656C76.1229 76.5717 78.2767 72.9715 78.2767 66.6448V56.3367C82.9253 58.6593 85.7291 64.285 85.742 70.7231C85.7178 82.8484 74.464 93.0951 61.2682 93.0951C60.961 93.0951 60.7265 93.0951 60.4193 93.0822C51.3678 93.0709 43.4109 89.8017 36.9658 83.3523C32.3284 78.7086 29.156 72.7987 27.877 66.3734C26.5981 59.9353 27.2497 53.2775 29.7705 47.2076C32.2799 41.1507 36.5341 35.9659 41.9944 32.3172C47.4548 28.6685 53.8756 26.727 60.442 26.727V19.9707C55.1902 19.9707 49.9885 21.0028 45.1426 23.0056C40.2967 25.0085 35.8825 27.9562 32.1684 31.655C24.6658 39.1365 20.4473 49.296 20.4473 59.8868C20.4473 70.476 24.6529 80.6372 32.1425 88.1316C39.6321 95.6261 49.8026 99.8401 60.4048 99.8401H61.2537C64.5134 99.8401 67.7602 99.3362 70.8841 98.3655C70.897 98.3655 70.9083 98.3526 70.9213 98.3526C75.4341 96.9522 79.567 94.5682 83.0353 91.375C89.0244 85.8462 92.3213 78.5374 92.3456 70.7603C92.3569 70.7345 92.3439 70.0964 92.3439 70.0835Z" fill="white"/>
|
|
4
|
+
</svg>
|
package/bin/gd
ADDED
package/out/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { }
|