# SureOps Deployment and Project Details

This project includes build scripts and Dockerfiles for deploying various types of projects (Node.js, Python, Java, Go, Docker, and generic) using SureOps.

## Project Structure

The repository contains build scripts (`build.sh`) within `sureops/deployment` for each project type.  Dockerfiles are included where applicable.

`sureops/test12july-back-b` contains a sample Spring Boot backend project, `sureops/test12july-front-f` contains a sample Angular frontend project.

## Deployment

### Generic build.sh

The enhanced `build.sh` script in `sureops/deployment` auto-detects the project type based on the presence of specific files (e.g., `package.json` for Node.js, `requirements.txt` for Python) and performs the appropriate build steps. It also handles dependency installation and basic testing for some project types.

### Project-Specific build.sh (e.g., test12july-back-b)

The project-specific `build.sh` scripts (e.g. in `sureops/test12july-back-b/deployment`) handle building and pushing Docker images to a specified registry. These scripts utilize secrets stored in SureOps (e.g. Docker credentials, Gitea credentials) using `sv get`. The build process is optimized with caching and retry logic. After a successful build and push, the scripts trigger an update to the repository metadata using a `curl` command to a SureOps endpoint.

### Frontend Deployment (test12july-front-f)

The frontend deployment process involves building an Angular application and serving it using Nginx.  The Dockerfile retrieves code from a Gitea repository, builds the Angular project, and copies the resulting artifacts into an Nginx container.

### Backend Deployment (test12july-back-b)

The backend deployment process involves building a Spring Boot application with Maven and packaging it into a JAR file.  The Dockerfile utilizes a multi-stage build to reduce the final image size, retrieving code from Gitea, performing the Maven build, and finally creating a smaller runtime image.

## Project Specifics (test12july Example)

This example project, `test12july`, showcases a frontend-backend application deployment.  The backend (`test12july-back-b`) is a Spring Boot application built with Maven, and the frontend (`test12july-front-f`) is an Angular application served with Nginx.

The backend exposes several API endpoints (CRUD operations for `Accesstype`, etc.). It includes authentication and authorization functionalities.  The frontend interacts with these backend endpoints.

This example demonstrates how SureOps can be used to manage the entire build and deployment pipeline, including secret management, repository integration, and automated build triggers.