# Deploy AyaNova (Raven)

After the [build](build-ayanova.md) has completed successfully move on to here:

## UPLOAD INSTALLERS TO NEXT FOLDER

Use FileZilla to upload releases to ayanova.com/download/next staging folder for testing

## TEST

### Test install to devops server

This assumes want to test the upgrade process, if want to erase the db entirely to start fresh then edit config.json and
add or ensure is set:

`"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true",`

Run the appropriate for build type being tested standard upgrade script (except this one comes from next folder) to upgrade test server instance.

#### PERPETUAL BUILD

test.helloayanova.com main devops

```bash
cd /var/ayanova && \
sudo systemctl stop ayanova.service && \
sudo curl -O https://www.ayanova.com/download/next/ayanova-linux-x64-server.zip && \
sudo rm \*.dll && \
sudo rm -r ./resource && \
sudo rm -r ./wwwroot && \
sudo unzip -o ayanova-linux-x64-server.zip -x "config.json" && \
sudo systemctl start ayanova.service
```

(a261 server)

```bash
cd /var/ayanovaa261 && \
sudo systemctl stop ayanovaa261.service && \
sudo curl -O https://www.ayanova.com/download/next/ayanova-linux-x64-server.zip && \
sudo rm \*.dll && \
sudo rm -r ./resource && \
sudo rm -r ./wwwroot && \
sudo unzip -o ayanova-linux-x64-server.zip -x "config.json" && \
sudo systemctl start ayanovaa261.service
```

#### SUBSCRIPTION BUILD

Devops:

```bash
cd /var/ayanova && \
sudo systemctl stop ayanova.service && \
sudo curl -O https://www.ayanova.com/download/next/ayanova-subscription-linux-x64-server.zip && \
sudo rm \*.dll && \
sudo rm -r ./resource && \
sudo rm -r ./wwwroot && \
sudo unzip -o ayanova-subscription-linux-x64-server.zip -x "config.json" && \
sudo systemctl start ayanova.service
```

(a261 server)

```bash
cd /var/ayanovaa261 && \
sudo systemctl stop ayanovaa261.service && \
sudo curl -O https://www.ayanova.com/download/next/ayanova-subscription-linux-x64-server.zip && \
sudo rm \*.dll && \
sudo rm -r ./resource && \
sudo rm -r ./wwwroot && \
sudo unzip -o ayanova-subscription-linux-x64-server.zip -x "config.json" && \
sudo systemctl start ayanovaa261.service
```

### Test install to windows server

Run installer on Windows test server.

### Run e2e tests against Linux and Windows servers

First adjust to the server desired by editing cypress.json and commenting in or out apiBaseUrl and BaseUrl props for local or devops or wherever
C:\data\code\raven-test\e2e>npm run all-chrome
(chrome most reliable but _will_ fail intermittently so needs multiple runs often)
Once tests pass move on to next step

### Run load tests against Linux and Windows servers

(determine if any changes triggered performance issues, needs baseline comparison value)

LOAD TESTING STEPS:
Login to server to test and seed fresh data first, then can run this test
run C:\data\code\raven-test\load\runtest.bat
Test will take approximately 14 minutes to run
Check results in results folder by opening index.html from windows explorer and view in browser

BASELINE WHAT TO CHECK:
DASHBOARD PAGE is the main page with the main stats:
"REquests summary"
The most telling overall stat is the "Requests summary" pie chart pass/fail ratio on the main page
As of today 2021-12-21 release 8-beta.06 the results are PASS: 92.87%, FAIL: 7.13%
Errors _are_ expected, it's a stress / load test but there shouldn't be an entirely failing route, just a scattered set of failures,
typically unauthorized or bad gateway

"Appdex" - skipping this for now, not really relevant at the moment

"STATISTICS" table - this is the important one as it shows failures

-   Scroll down and look in "executions" -> "FAIL" column and make sure they are not all in one line item
    if see a lot of failures in a single route need to manually look into that exact issue and route and examine the jmeter test for that route / run it manually perhaps
    it's normal to see unauthorized or bad gateway errors when the server is super stressed out but other failures might need examination or all of it if less than 90% success

NOTES:

-   this also catches reporting as it generates some reports
    report-render test has explicit report id number for workorder, currently it's 15 for the dispatch report, if all fail it may have changed the id number
    would be better deterministically but for now this works.

-   To test local or devops edit the project file "C:\data\code\raven-test\load\stressdevops.jmx"
    There are two configuration sections near top for local or devops and it's switched by setting either enabled or disabled:
    <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="Devops request defaults" enabled="true">
    or
    <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="Localhost request defaults" enabled="false">
-   Load test needs fresh seeding so it can create test users.

Once tests pass within expected parameters move on to next step

## RELEASE

Release here means move from next folder to main download folder /var/www/html/ayanova.com/download/ and archive a copy in old and post about it on website / forum etc.

Note: linux copy command overwrites by default and changes timestamp by default

### Copy to public download folder

Copy the files from next to main preserving timestamp:
**From** the `next` folder:

```bash
root@ubuntu-s-1vcpu-1gb-amd-sfo3-01:/var/www/html/ayanova.com/download/next# cp * ../ -p
```

This will overwrite the previous release installers with the next release installers.

Confirm the files copied properly before moving on.

### Copy to old download folder

Users with expired maintenance agreements are allowed to install up to the build date within the date their agreement expired so we will need to provide old downloads to those people for some period of time.

Make a folder in the download/old directory named the same as the **build date** of the installers. For example if there was a release on July 1 2025 then make a folder called `2025-07-01` and copy the current build there:

```bash
root@ubuntu-s-1vcpu-1gb-amd-sfo3-01:/var/www/html/ayanova.com/download/next# mkdir ../old/2025-07-01
root@ubuntu-s-1vcpu-1gb-amd-sfo3-01:/var/www/html/ayanova.com/download/next# cp * ../old/2025-07-01/ -p
```

Confirm the files and folder are present before moving on.

### Clean next folder

Make sure you're in the next folder then erase all files:

```bash
root@ubuntu-s-1vcpu-1gb-amd-sfo3-01:/var/www/html/ayanova.com/download/next# rm *
```

### Replace docs

If docs have changed need to update our static copy of the docs on our server:

Open FileZilla and login to server and be prepared to copy the moment after deletion so there is minimal downtime for the docs being available.

Clean out current one from web server: (DONT USE FILEZILLA TO DELETE IT TAKES FUCKING FOREVER)

**Careful** be sure in docs folder.

```bash
root@ubuntu-s-1vcpu-1gb-amd-sfo3-01:/var/www/html/ayanova.com/docs# rm * -r
```

Use FileZilla to upload the docs:

from here: `C:\data\code\raven\server\AyaNova\wwwroot\docs\`
to here: `/var/www/html/ayanova.com/docs`


## Update website changelog releases notes, forum etc

Add that info here as it get's set up
