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/lib
folder. If applicable, ShadowJar will replace previous versions ofPlanNUS.jar
with the latest version.- Command:
./gradlew shadowJar
- Command:
clean
: Deletes the files created during the previous build (i.e. files and folders that are in thebuild
folder)- Command:
./gradlew clean
- Command:
checkstyle
: Checks for styling compliance across the whole project- Command:
./gradlew checkstyleMain
: Checks for styling compliance in themain
package of PlanNUS - Command:
./gradlew checkstyleTest
: Checks for styling compliance in thetest
package of PlanNUS
- Command:
build
: Runs all availabletests
andcheckstyle
before packaging PlanNUS withShadowJar
if 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.txt
located in./text-ui-test
folder - Change the expected output in
EXPECTED.TXT
located in./text-ui-test
folder - 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.TXT
located in./text-ui-test
folder
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.