1 | # CH5 Utilities
|
2 |
|
3 | > Archiving and distribution utilities to be used for the applications implemented with CH5 library.
|
4 |
|
5 | ## Table of Contents
|
6 |
|
7 | - [Background](#background)
|
8 | - [Setup](#setup)
|
9 | - [Commands](#commands)
|
10 | - [Configuration](#configuration)
|
11 | - [License](#license)
|
12 |
|
13 | ## Background
|
14 |
|
15 | The purpose of the library is to satisfy three functions:
|
16 |
|
17 | - archiving - create a package that can distributed manually or with the utility
|
18 | - distribution - deploy a package built with the utility
|
19 | - archive & distribute - single command for both of the above
|
20 |
|
21 | The final result of the archiving will be a .ch5z package.
|
22 | This contains two files:
|
23 |
|
24 | - *.ch5 - the actual package
|
25 | - *_manifest.json - a manifest file describing the .ch5 file ( project name, timestamp, hash and any other optional details)
|
26 |
|
27 | ## Setup
|
28 |
|
29 | Install the required packages.
|
30 | ```
|
31 | yarn install
|
32 | ```
|
33 |
|
34 | Build the library.
|
35 | ```
|
36 | yarn build
|
37 | ```
|
38 |
|
39 | Publish the ch5-utilities library for local usage.
|
40 | ```
|
41 | yarn link
|
42 | ```
|
43 |
|
44 | ## Commands
|
45 |
|
46 | The commands is for development, debugging, and testing purposes only.
|
47 |
|
48 | Before running, make sure that all the values are properly modified for local usage, in the `config` variable in `start.ts`.
|
49 |
|
50 | #### yarn start
|
51 |
|
52 | Running `yarn start` will run the **archive&deploy** functions based on the config in the `src/start.ts` file.
|
53 |
|
54 | #### yarn start:archive
|
55 |
|
56 | Running `yarn start:archive` will run the **archive** function based on the config in the `src/start.ts` file.
|
57 |
|
58 | #### yarn start:distribute
|
59 |
|
60 | Running `yarn start:distribute` will run the **distribute** function based on the config in the `src/start.ts` file.
|
61 |
|
62 | #### yarn start:js
|
63 |
|
64 | Same as `yarn start`, but will run the bundled JS version of the library ( the one in the ``build`` directory ).
|
65 |
|
66 | #### yarn start:js:archive
|
67 |
|
68 | Same as `yarn start:archive`, but will run the bundled JS version of the library ( the one in the ``build`` directory ).
|
69 |
|
70 | #### yarn start:js:distribute
|
71 |
|
72 | Same as `yarn start:distribute`, but will run the bundled JS version of the library ( the one in the ``build`` directory ).
|
73 |
|
74 | #### yarn publish:local
|
75 |
|
76 | After the initial setup, you can use this command to rebuild and publish changes in the library.
|
77 |
|
78 | ## Configuration
|
79 |
|
80 | The methods `archiver` and `distributor` from `src/index.ts` expect a to get a configuration of type `IConfigOptions`.
|
81 |
|
82 | Below we describe each property, their purpose and possible values.
|
83 |
|
84 | #### projectName
|
85 |
|
86 | Required.
|
87 |
|
88 | The name of the project will set the package name and the manifest details for the project.
|
89 | It should be set according to the delivered package.
|
90 |
|
91 | Default value is ``crestron-system``.
|
92 |
|
93 | #### directoryName
|
94 |
|
95 | Required.
|
96 |
|
97 | This is the path to the directory that contains the deliverables.
|
98 |
|
99 | Currently this is the showcase-app dist directory.
|
100 |
|
101 | The path can be absolute or should be relative to the location from which the command is run in the CLI.
|
102 |
|
103 | #### outputDirectory
|
104 |
|
105 | Required.
|
106 |
|
107 | This is the path where the package files will be copied to.
|
108 |
|
109 | The path can be absolute or should be relative to the location from which the command is run in the CLI.
|
110 |
|
111 | #### outputLevel
|
112 |
|
113 | Optional
|
114 |
|
115 | This sets the level of CLI logging that is required.
|
116 |
|
117 | Possible values are: ``quiet | normal | verbose``.
|
118 |
|
119 | #### additionalAppuiManifestParameters
|
120 |
|
121 | Optional.
|
122 |
|
123 | This is a key-value collection that can be used to set extra details in the app ( in this case showcase-app ) manifest JSON file.
|
124 |
|
125 | #### additionalProjectManifestParameters
|
126 |
|
127 | Optional.
|
128 |
|
129 | This is a key-value collection that can be used to set extra details in the project manifest JSON file.
|
130 |
|
131 | #### controlSystemHost
|
132 |
|
133 | Required.
|
134 |
|
135 | This should be the hostname or IP address of the device where the package will be deployed.
|
136 |
|
137 | #### promptForCredential
|
138 |
|
139 | This will always be set to true, since the utility will always prompt for the credentials in the CLI.
|
140 |
|
141 | #### sftpDirectory
|
142 |
|
143 | Required.
|
144 |
|
145 | This is the target directory on the ``controlSystemHost``.
|
146 |
|
147 | It must be relative to the SFTP root directory.
|
148 |
|
149 | It will be ``display`` for the showcase-app, or ``HTML`` for CCS.
|
150 |
|
151 | #### deviceType
|
152 |
|
153 | Required.
|
154 |
|
155 | This should be set based on the ``controlSystemHost``, depending on what kind of device you are targeting for the deploy.
|
156 |
|
157 | Possible values are: ``touchscreen | controlsystem | web``.
|
158 |
|
159 | ## License
|
160 |
|
161 | Copyright (C) 2018 to the present, Crestron Electronics, Inc.
|
162 | All rights reserved.
|
163 | No part of this software may be reproduced in any form, machine
|
164 | or natural, without the express written consent of Crestron Electronics.
|
165 | Use of this source code is subject to the terms of the Crestron Software
|
166 | Development Tools License Agreement under which you licensed this source code.
|
167 |
|
168 | If you did not accept the terms of the license agreement,
|
169 | you are not authorized to use this software. For the terms of the license,
|
170 | please see the license agreement between you and Crestron at http://www.crestron.com/sla.
|