Deployment Guide
Relevant source files
The following files were used as context for generating this wiki page:This document provides a comprehensive guide for deploying the zalopay application. The project is a Java-based Spring Boot web application, built and managed using Apache Maven. This guide covers prerequisites, configuration, build procedures, and the continuous integration pipeline.
The application is identified in the build configuration as stt (Speech-to-Text), suggesting its core functionality, and is packaged as a standalone JAR file for execution.
Sources: pom.xml:6-11, src/main/java/com/sondk/stt/ZalopayApplication.java:5-11
1. System Prerequisites
Before building and deploying the application, ensure the following prerequisites are met on the target system. These are defined by the project's build configuration and the CI pipeline.
| Prerequisite | Version | Source File |
|---|---|---|
| Java Development Kit (JDK) | 11 | pom.xml:16 |
| Apache Maven | 3.x | pom.xml |
The project utilizes the spring-boot-starter-parent version 2.6.3, which manages dependency versions for a consistent build. The primary application dependency is spring-boot-starter-web, indicating it is a web application.
Sources: pom.xml:12-17, pom.xml:23-27, .github/workflows/maven.yml:16-18
2. Application Configuration
Application behavior can be modified via the application.properties file located in src/main/resources. These settings are loaded at runtime by the Spring Boot framework.
| Property | Value | Description |
|---|---|---|
server.port | 8081 | The port on which the embedded web server will listen for incoming HTTP requests. |
spring.main.banner-mode | off | Disables the Spring Boot banner that is printed on startup. |
logging.level.root | info | Sets the root logging level to INFO. |
Sources: src/main/resources/application.properties:1-3
3. Building the Application
The application is built using Apache Maven, which compiles the source code, runs tests, and packages it into an executable JAR file.
Build Process
The standard build process is defined by the Maven package lifecycle phase. The CI pipeline uses the following command to build the project:
mvn -B package --file pom.xml
This command performs the following steps:
- Validates the project.
- Compiles the source code.
- Runs any tests.
- Packages the compiled code into a JAR file in the
target/directory. The resulting artifact will be namedstt-0.0.1-SNAPSHOT.jar.
Sources: .github/workflows/maven.yml:20, pom.xml:7-9
The build process can be visualized as follows:
This diagram shows the sequence of Maven goals executed during the package phase.
Sources: .github/workflows/maven.yml:20
4. Running the Application
Once the application is packaged into an executable JAR, it can be run from the command line.
- Navigate to the
targetdirectory where the JAR file was created. - Execute the following command:
java -jar stt-0.0.1-SNAPSHOT.jar
This command starts the Spring Boot application, which in turn starts the embedded web server. The application will be available on the port specified in the application.properties file (default: 8081). The main entry point for the application is the ZalopayApplication class.
Sources: src/main/java/com/sondk/stt/ZalopayApplication.java:8-11, src/main/resources/application.properties:1
5. Continuous Integration (CI) Pipeline
The project includes a GitHub Actions workflow for Continuous Integration. This pipeline automates the build process to ensure code quality and integrity.
CI Workflow
The workflow is defined in .github/workflows/maven.yml and has the following characteristics:
- Name:
Java CI with Maven - Triggers: Runs on every
pushandpull_requestto themainbranch. - Environment: Executes on an
ubuntu-latestrunner.
The following diagram illustrates the steps in the CI pipeline:
This diagram outlines the automated build process managed by GitHub Actions.
Sources: .github/workflows/maven.yml:1-20
Workflow Steps
- Checkout Code: The
actions/checkout@v3action checks out the repository's source code. - Set up JDK: The
actions/setup-java@v3action configures the runner with Java version 11. - Build with Maven: The
mvn -B package --file pom.xmlcommand is executed to compile, test, and package the application. The-Bflag runs Maven in non-interactive (batch) mode.
Sources: .github/workflows/maven.yml:14-20
Summary
The zalopay project is a standard Spring Boot web application deployed as an executable JAR. Deployment involves ensuring Java 11 and Maven are installed, building the project with mvn package, and running the resulting JAR file. Configuration is managed through the application.properties file. A GitHub Actions CI pipeline is in place to automate the build and verification process on every change to the main branch, ensuring a stable and consistent deployment artifact.