DevOps Guide for PlanNUS
|
Table of contents
Build Automation
PlanNUS uses Gradle for build automation and dependency management.
Below shows how Gradle is being used in PlanNUS for important project tasks
test: Runs all available test- Command:
./gradlew clean test: Cleans the project before running the test - Command:
./gradlew test: Runs all the test
- Command:
shadowJar: ShadowJar plugin is responsible for packaging PlanNUS into a fat JAR file, which is located underbuild/libfolder. If applicable, ShadowJar will replace previous versions ofPlanNUS.jarwith the latest version.- Command:
./gradlew shadowJar
- Command:
clean: Deletes the files created during the previous build (i.e. files and folders that are in thebuildfolder)- Command:
./gradlew clean
- Command:
checkstyle: Checks for styling compliance across the whole project- Command:
./gradlew checkstyleMain: Checks for styling compliance in themainpackage of PlanNUS - Command:
./gradlew checkstyleTest: Checks for styling compliance in thetestpackage of PlanNUS
- Command:
build: Runs all availabletestsandcheckstylebefore packaging PlanNUS withShadowJarif project passed all test cases and style check without issue.- Command:
./gradlew build
- Command:
Continuous Integration (CI)
PlanNUS uses GitHub Actions for continuous integration. The necessary GitHub Actions configuration files exist as .github/workflows/gradle.yml. This file does not require further set up.
I/O Testing
PlanNUS uses automated scripts located in the ./text-ui-test folder to test for the correct output given a sequence of inputs.
To test for the input/output of PlanNUS
- Change needed input in
input.txtlocated in./text-ui-testfolder - Change the expected output in
EXPECTED.TXTlocated in./text-ui-testfolder - Run the scripts for testing
- On windows, run
runtest.bat - On UNIX systems, run
runtest.sh
- On windows, run
- The scripts will run and throws a warning message if the actual output differs from the expected output
- The actual output will be stored in
ACTUAL.TXTlocated in./text-ui-testfolder
Making a release
Here are the steps to create a new release.
- Generate a fat JAR file using Gradle with the command
gradlew build. - Tag the repo with the version number. e.g.
V2.0 - Create a new release using GitHub. Upload the JAR file you created.