The development environment can be prepared on a Fedora or CentOS 7 machine.
Follow these steps:
prepare the environment
do your modification to API or UI
sync your modification to the server where Cockpit is running
Install UI requirements¶
Prepare the development environment:
- Install developer tools: npm and git
dnf install npm git
yum install npm git
Clone the repository:
git clone email@example.com:NethServer/nethserver-cockpit
Enter inside the cloned repository and install all ui dependencies:
cd nethserver-cockpit/ui npm install
Build the UI¶
Note: during the development, the UI must run on the NethServer server. Running the UI on the developer machine will not work due to Cockpit CORS limitations.
nodejs >= 10
Enter UI directory and build using
cd ui/ && ./prep-sources
Make sure to create the
/root/.local/share/cockpit/nethserver directory inside your NethServer.
You can do it using this command, assuming the NethServer has IP
ssh firstname.lastname@example.org "mkdir -p ~/.local/share/cockpit/nethserver"
Sync API and UI¶
Files can be copied using rsync.
To copy the APIs, use the following command:
cd api/ && rsync -avz --delete ./* email@example.com:/usr/libexec/nethserver/api/
Before copying the UI, make sure to compile it as explained in the paragraph above.
To copy the UI, use the following command:
cd ui/ && rsync -avz --delete dist/* firstname.lastname@example.org:~/.local/share/cockpit/nethserver/
Please use configuration from EditorConfig.