Added support of new image_url field
[src/xds/xds-server.git] / scripts / sdks / README.md
1 # SDKs management scripts
2
3 To support a new SDK family, you must create a new directory under
4 `scripts/sdk/xxx` where xxx is the new SDK family.
5
6 Then you must create the following scripts (or executable) :
7
8 - `add`: add a new SDK
9 - `db-dump`: returned the list of available SDKs (JSON format)
10 - `db-update`: update SDKs database
11 - `get-family-config`: returned SDK family configuration structure (JSON format)
12 - `get-sdk-info`: extract SDK info (JSON format) from a SDK file/tarball
13 - `remove`: remove an existing SDK
14
15 ## `add`
16
17 add a new SDK
18
19 This script returns code 0 when sdk is successfully installed, else returns an
20 error code.
21
22 List of parameters to implement:
23
24 - `-f|--file <filepath>` :  install a SDK using a file
25 - `--force`:                force SDK install when a SDK already in the same destination directory
26 - `-u|--url <url>` :        download SDK using this URL and then install it
27 - `-no-clean` :             don't cleanup temporary files
28 - `-h|--help` :             display help
29
30 ## `db-dump`
31
32 Returned the list all SDKs (available and installed) using JSON format.
33
34 ```json
35 [
36   {
37     "name":         "My SDK name",
38     "uuid":         "a-unique-id",
39     "description":  "A description",
40     "profile":      "profile",
41     "version":      "version",
42     "arch":         "architecture",
43     "path":         "path where sdk installed locally",
44     "url":          "https://website.url.to.download.sdk",
45     "image_url":    "https://website.url.to.download.image",
46     "status":       "Not Installed | Installed",
47     "date":         "2017-12-25 00:00",
48     "size":         "123 MB",
49     "md5sum":       "123456789",
50     "setupFile":    "path to file to setup SDK environment"
51   }, {
52     "name":         "My SDK name 2",
53     "description":  "A description 2",
54     ...
55   }
56   ...
57 ]
58 ```
59
60 ## `db-update`
61
62 Update sdk database that may be used by `list` command.
63
64 ## `get-family-config`
65
66 Returned SDK configuration as JSON format:
67
68 ```json
69 {
70     "familyName": "xxx",
71     "description": "bla bla",
72     "rootDir": "/yyy/zzz",
73     "envSetupFilename": "my-envfilename*",
74     "scriptsDir": "scripts_path"
75 }
76 ```
77
78 where:
79
80 - `familyName` : sdk familyName (usually same name used as xxx directory)
81 - `rootDir` : root directory where SDK are/will be  installed
82 - `envSetupFilename` : sdk files (present in each sdk) that will be sourced to
83   setup sdk environment
84
85 ## `get-sdk-info`
86
87 Extract SDK info, such as name, version, ... from a SDK tarball file (when
88 --file option is set) or from a url (when --url option is set).
89
90 This script may also be used to check that a SDK tarball file is correct in
91 order to determine for example that the SDK family.
92
93 List of parameters to implement:
94
95 - `-f|--file <filepath>` :  SDK tarball file used to get SDK info
96 - `-u|--url <url>` :        url link used to get SDK info
97 - `--md5` :                 md5sum value used to validate SDK tarball file
98 - `-h|--help` :             display help
99
100 This script returns an error (value different from 0) and potential print an
101 error message. Else when info are successfully extracted, this script must
102 returned the following JSON structure:
103
104 ```json
105 {
106     "name":         "My SDK name",
107     "uuid":         "a-unique-id",
108     "description":  "A description",
109     "profile":      "profile",
110     "version":      "version",
111     "arch":         "architecture",
112     "path":         "",
113     "url":          "https://website.url.to.download.sdk",
114     "image_url":    "https://website.url.to.download.image",
115     "status":       "Not Installed",
116     "date":         "2017-12-25 00:00",
117     "size":         "123 MB",
118     "md5sum":       "123456789",
119     "setupFile":    "path to file to setup SDK environment"
120 }
121 ```
122
123 ## `remove`
124
125 Remove an existing SDK
126
127 The first argument is the full path of the directory of the SDK to removed.