Skip to content

Commit 769f74b

Browse files
authored
Simplify development docs (hestiacp#4155)
1 parent ac2802b commit 769f74b

File tree

2 files changed

+28
-57
lines changed

2 files changed

+28
-57
lines changed

docs/docs/contributing/building.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ cd ./hestiacp/
2020
# Replace main with the branch you want to test
2121
git checkout main
2222

23-
# Install Dependencies
24-
npm install
25-
# Build
26-
npm run build
27-
2823
cd ./src/
2924

3025
# Compile packages

docs/docs/contributing/development.md

Lines changed: 28 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,14 @@ Development builds are unstable. If you encounter a bug please [report it via Gi
1212

1313
These are example instructions for creating a virtual machine running Hestia for development.
1414

15-
These instructions use [Multipass](https://multipass.run/) to create the VM. Feel free to adapt the commands for any virtualization software you prefer.
15+
These instructions use [Multipass](https://multipass.run/) to create an Ubuntu VM. Feel free to adapt the commands for any virtualization software you prefer.
1616

17-
::: warning
18-
Sometimes the mapping between the source code directory on your local machine to the directory in the VM can be lost with a "failed to obtain exit status for remote process" error. If this happens simply unmount and remount e.g.
19-
20-
```bash
21-
multipass unmount hestia-dev
22-
multipass mount $HOME/projects/hestiacp hestia-dev:/home/ubuntu/hestiacp
23-
```
24-
25-
:::
26-
27-
1. [Install Multipass](https://multipass.run/install) for your OS.
17+
1. [Install Multipass](https://multipass.run/install) for your OS
2818

2919
1. [Fork Hestia](https://github.com/hestiacp/hestiacp/fork) and clone the repository to your local machine
3020

3121
```bash
32-
git clone https://github.com/YourUsername/hestiacp.git $HOME/projects
22+
git clone https://github.com/YourUsername/hestiacp.git ~/projects
3323
```
3424

3525
1. Create an Ubuntu VM with at least 2GB of memory and 15GB of disk space
@@ -40,41 +30,27 @@ multipass mount $HOME/projects/hestiacp hestia-dev:/home/ubuntu/hestiacp
4030
multipass launch --name hestia-dev --memory 4G --disk 15G --cpus 4
4131
```
4232

43-
1. Map your cloned repository to the VM's home directory
33+
1. Mount your cloned repository to the VM's home directory
4434

4535
```bash
46-
multipass mount $HOME/projects/hestiacp hestia-dev:/home/ubuntu/hestiacp
36+
multipass mount ~/projects/hestiacp hestia-dev:/home/ubuntu/hestiacp
4737
```
4838

49-
1. SSH into the VM as root and install some required packages
39+
1. SSH into the VM as root then install some required packages
5040

5141
```bash
5242
multipass exec hestia-dev -- sudo bash
5343
sudo apt update && sudo apt install -y jq libjq1
5444
```
5545

56-
1. Outside of the VM (in a new terminal) ensure [Node.js](https://nodejs.org/)
57-
16 or later is installed
58-
59-
```bash
60-
node --version
61-
```
62-
63-
1. Install dependencies and build the theme files
64-
65-
```bash
66-
npm install
67-
npm run build
68-
```
69-
70-
1. Back in the VM terminal, navigate to `/src` and build Hestia packages
46+
1. Navigate to `/src` in the VM then build Hestia packages
7147

7248
```bash
7349
cd src
7450
./hst_autocompile.sh --all --noinstall --keepbuild '~localsrc'
7551
```
7652

77-
1. Navigate to `/install` and install Hestia with these flags
53+
1. Navigate to `/install` in the VM then install Hestia with these flags
7854

7955
_(update the [installation flags](../introduction/getting-started#list-of-installation-options) to your liking, note that login credentials are set here)_
8056

@@ -89,7 +65,9 @@ multipass mount $HOME/projects/hestiacp hestia-dev:/home/ubuntu/hestiacp
8965
reboot
9066
```
9167

92-
1. Find the IP address of the VM
68+
1. On your local machine, find the IP address of the VM
69+
70+
_(give the VM time to reboot for the IP to appear)_
9371

9472
```bash
9573
multipass list
@@ -99,31 +77,29 @@ multipass mount $HOME/projects/hestiacp hestia-dev:/home/ubuntu/hestiacp
9977

10078
_(proceed past any SSL errors you see when loading the page)_
10179

102-
```bash
103-
e.g. https://192.168.64.15:8083
104-
```
80+
e.g. <https://192.168.64.15:8083>
10581

10682
Hestia is now running in a virtual machine. If you'd like to make changes to the source code and test them in your browser, please continue to the next section.
10783

108-
## Making changes to Hestia
84+
::: warning
85+
Sometimes (with Multipass) the mapping between the source code directory on your local machine to the directory in the VM can be lost with a "failed to obtain exit status for remote process" error. If this happens simply unmount and remount e.g.
10986

110-
After setting up Hestia in a VM you can now make changes to the source code at `$HOME/projects/hestiacp` on your local machine (outside of the VM) using your editor of choice.
87+
```bash
88+
multipass unmount hestia-dev
89+
multipass mount ~/projects/hestiacp hestia-dev:/home/ubuntu/hestiacp
90+
```
11191

112-
The following are example instructions for making a change to Hestia's UI and testing it locally.
92+
:::
11393

114-
1. At the root of the project on your local machine, ensure the latest packages are installed
94+
## Making changes to Hestia
11595

116-
```bash
117-
npm install
118-
```
96+
After setting up Hestia in a development VM you can now make changes to the source code at `~/projects/hestiacp` on your local machine (outside of the VM) using your editor of choice.
11997

120-
1. Make a change to a file that we can later test, then build the UI assets
98+
Below are some instructions for making a change to Hestia's UI, running the build script and testing the change locally.
12199

122-
_e.g. change the body background color to red in `web/css/src/base.css` then run:_
100+
1. On your local machine, make a change to a file that is easy to test
123101

124-
```bash
125-
npm run build
126-
```
102+
_e.g. change the body background color to red in `web/css/src/base.css`_
127103

128104
1. SSH into the VM as root and navigate to `/src`
129105

@@ -138,15 +114,15 @@ The following are example instructions for making a change to Hestia's UI and te
138114
./hst_autocompile.sh --hestia --install '~localsrc'
139115
```
140116

141-
1. Reload the page in your browser to see your changes
117+
1. Reload the page in your browser to see the change
118+
119+
Please refer to the [contributing guidelines](https://github.com/hestiacp/hestiacp/blob/main/CONTRIBUTING.md#development-guidelines) for more details on submitting code changes for review.
142120

143121
::: info
144-
A backup is created each time the Hestia build script is run. If you run this a lot it can fill up your VM's disk space.
122+
A backup is created each time the Hestia build script is run. If you run this often it can fill up your VM's disk space.
145123
You can delete the backups by running `rm -rf /root/hst_backups` as root user on the VM.
146124
:::
147125

148-
Please refer to the [contributing guidelines](https://github.com/hestiacp/hestiacp/blob/main/CONTRIBUTING.md) for more details on submitting code changes for review.
149-
150126
## Running automated tests
151127

152128
We currently use [Bats](https://github.com/bats-core/bats-core) to run our automated tests.

0 commit comments

Comments
 (0)