Skip to content

Commit

Permalink
Merge pull request #25 from richard-austin/update-for-deb-installatio…
Browse files Browse the repository at this point in the history
…n-on-ubuntu-24.04

Update for Ubuntu 24.04/tomcat10
  • Loading branch information
richard-austin authored Jun 3, 2024
2 parents 638a3b1 + 87530a1 commit f1a7d28
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,29 @@ Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app w

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build
## Build
```bash
./gradlew buildDebFile
```

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
## Install from deb file
The deb file installation requires Ubuntu 24.04 and has tomcat10 as a dependency.

The build script build.sh will run a production build with the base url set to dc and package the application in dc.war for deployment.
## Running unit tests
The deb file produced by the build will be at ***[YOUR_HOME_DIR]***/drawdown-calculator/deb-file-creation.
The name will be similar to dc_2.1.0_arm64.deb.
Copy it to your Ubuntu ARM64 machine (i.e. Raspberry pi).

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
On the Raspberry pi, Install from the .deb file
```bash
sudo apt install ./dc_2.1.0_arm64.deb
```
Tomcat 10 will start

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
The Drawdown Calculator can be accessed at http://***[server ip address]***:8080/dc

## Install war.file
To use with other Tomcat versions, just copy the file dc.war
(at ***[YOUR_HOME_DIR]***/drawdown-calculator/dist) to the tomcat webapps folder.
## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
6 changes: 3 additions & 3 deletions deb-file-creation/create-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Version: $VERSION
Architecture: arm64
Maintainer: Richard Austin <richard.david.austin@gmail.com>
Description: A pension drawdown calculator.
Depends: openjdk-11-jre-headless (>=11.0.11), openjdk-11-jre-headless (<< 12.0.0),
tomcat9 (>=9.0.43-1), tomcat9 (<= 10.0.0),
tomcat9-admin (>=9.0.43-1), tomcat9-admin (<= 10.0.0)
Depends: openjdk-17-jre-headless (>=17.0.0), openjdk-17-jre-headless (<< 17.9.9),
tomcat10 (>=10.0.0), tomcat10 (<< 11.0.0),
tomcat10-admin (>=10.0.0), tomcat10-admin (<< 11.0.0)
EOF

dpkg-deb --build --root-owner-group dc_"${VERSION}"_arm64
10 changes: 5 additions & 5 deletions deb-file-creation/postinst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

mv /tmp/dc.war /var/lib/tomcat9/webapps/dc.war
rm -r /var/lib/tomcat9/webapps/dc || true
rm -r /var/lib/tomcat10/webapps/dc || true
mv /tmp/dc.war /var/lib/tomcat10/webapps/dc.war

chown tomcat:tomcat /var/lib/tomcat9/webapps/dc.war
deb-systemd-invoke enable tomcat9.service
deb-systemd-invoke start tomcat9.service
chown tomcat:tomcat /var/lib/tomcat10/webapps/dc.war
deb-systemd-invoke enable tomcat10.service
deb-systemd-invoke start tomcat10.service
4 changes: 2 additions & 2 deletions deb-file-creation/postrm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

rm /var/lib/tomcat9/webapps/dc.war || true
rm -r /var/lib/tomcat9/webapps/dc || true
rm /var/lib/tomcat10/webapps/dc.war || true
rm -r /var/lib/tomcat10/webapps/dc || true

0 comments on commit f1a7d28

Please sign in to comment.