Sets up a Java environment and various services, including PostgreSQL, Elasticsearch, MinIO, and MongoDB.
Builds the application using Maven, with an option to skip tests.
Artifacts (JAR files) are uploaded for use in deployment.
2. Deployment Job:
These phases require approval in GitHub action by Environment Reviewer configured in repo settings
Downloads the built artifacts and prepares them for deployment.
Copies the JAR file to a specified server location.
Executes a script to deploy the application to a blue node, ensuring minimal downtime.
This copies built backend files to a dedicated blue folder run systemctl service for blue node and wait for it to be active
3. Start New Backend:
This phases also require approval
Applies the blue node version to the green node, making the new backend version live for users.
Make nginx switch traffic to blue node, after that update green_folder with the same new version (same as blue folder), reload green systemctl service, wait for server to start, and then reroute traffic back to green_folder
How should this be tested?
A description of what steps someone could take to:
Validate that the scripts are correctly configured to trigger on the appropriate events.
You can commit anything to this branch to trigger the script and before merge start on push can be modified
After the workflow is merged to the main, manual action start will be available:
Checklist
[ ] I have tested these changes locally
[ ] I have added tests that cover these changes (if applicable)
[ ] I have updated the documentation (if applicable)
[ ] I have added or updated the necessary comments in the code
Related: https://github.com/sci2zero/TeslaRIS-frontend/pull/23
Description
Created workflow in 3 phases
1. Build Job:
2. Deployment Job:
These phases require approval in GitHub action by Environment Reviewer configured in repo settings
3. Start New Backend:
This phases also require approval
How should this be tested?
A description of what steps someone could take to:
Validate that the scripts are correctly configured to trigger on the appropriate events. You can commit anything to this branch to trigger the script and before merge start on push can be modified
After the workflow is merged to the main, manual action start will be available:
Checklist