This project currently provides tooling for the ESD tech stack that is compatible with Docker, IntelliJ, and NetBeans.
Other Documents:
- Planning and Specification Documents
- Sprint 1
- Sprint 2
- Sprint 3
Requirements:
Optional development dependencies:
Steps:
- Clone the repo
git clone https://github.com/novucs/esd.git && cd esd
- Build the repo
./gradlew autodeploy
(for UNIX) orgradlew.bat autodeploy
(for Windows) - Run the project
docker-compose up -d
- Open the app in your web browser
When docker-compose is running, execute the relevant command to automatically build and deploy the project:
- UNIX:
./gradlew autodeploy -t
- Windows:
gradlew.bat autodeploy -t
During development, to run all CI checks locally you may perform the following command:
./gradlew checkBuildReport
All the reports for any check/test failures will be saved into the relevant directory under:
./build/reports/
In order to compile your SCSS files to CSS, please make sure you've installed Node and NPM.
- Install Node via
apt-get install node
- Run
npm install -g gulp
to install Gulp for your system. - Run
npm install
in the repository root to install the dependencies required for Gulp. - Run
gulp
to compile SCSS.
IntelliJ:
File -> Open -> <select repo location>
File -> Settings -> Editor -> Code Style -> Scheme Cog -> Import Scheme -> IntelliJ IDEA code style XML -> config/codestyles/GoogleStyle.xml
NetBeans:
File -> Open Project -> <select repo location>
NetBeans for UWE machines:
Tools -> Plugins -> Available Plugins -> Gradle Support -> Install
File -> Open Project -> <select repo location>
Tools -> Options -> Miscallenous -> Gradle -> Scripts & Tasks -> Gradle arguments
- Add
netbeansdeploy
- Add
- Make sure to start the GlassFish server via the 'Services' tab:
- Right-click
Servers -> GlassFish Server 4.1.1
and clickStart
- Right-click
- If
netbeansdeploy
build location is invalid, update task in thebuild.gradle
file to match the GlassFish location.- For example:
C:\\Users\\r2-benson\\AppData\\Roaming\\Netbeans\\8.2\\config\\GF_4.1.1\\domain1\\autodeploy
- For example:
- To deploy, click the big fancy Green Play button!
To debug requests coming into Servelets you must enable remote debugging on Glassfish then connect to the remote instance in your IDE
-
Set up remote debug configuration in IntelliJ
Go to Run > Edit Configurations and add a new Remote configuration.
Set the port to 9009 and the classpath to esd and save.
-
Run the Debugger
From within Intellij, run the remote debug configuration you have just setup. The debug window will popup and say.
Connected to the target VM, address: 'localhost:9009', transport: 'socket'
Connecting to localhost:8080 and placing a breakpoint in the servlet code should break whenever a request hits the endpoint.
To perform code checks with: ./gradlew check
Code quality reports will be generated after running checks, view them locally at:
- CheckStyle:
./build/reports/checkstyle/main.html
- PMD:
./build/reports/pmd/main.html
- SpotBugs:
./build/reports/spotbugs/main.html
- Tests:
./build/reports/tests/test/index.html
If any lint checks seem out of place, and are difficult to work with please let @novucs know.
Feel free to branch off this repo in the format feature/{ticket-number}-{name-of-feature}
e.g.
feature/123-add-user-create-endpoint
. The CI/CD pipeline will not execute on forks of this
repository, so its advisable to actively maintain branches here. Though feel free to do what you
want. I'm not your mum.
Once you have completed a feature, open a pull request to the master branch. If CI is passing, and
you are happy with your code, ask another member of the team to do a code review. When all checks
are green, hit Squash and merge
.
There are currently two types of deployments accessible from the CI/CD pipeline:
All repository releases are marked via tags, and are accessible here.