-
Notifications
You must be signed in to change notification settings - Fork 0
automations and artifact generation
The CI/CD pipeline for the Currency Conversion API includes various automations to streamline the development process and ensure consistency. Below are the key automations and artifact generation steps included in the pipeline.
PlantUML diagrams are generated automatically as part of the CI/CD process. The diagrams are rendered and committed to the repository to keep the documentation up-to-date.
The pipeline generates several documentation files, including CHANGELOG.md, .env, DIRECTORY.md, swagger.json, swagger.yaml, and Java documentation in Markdown format. These files are automatically updated and committed to the repository if there are changes.
Maven dependencies are cached to speed up the build process. The cache is created based on the pom.xml file, and the dependencies are restored from the cache if available.
A Python script is used to adjust the Markdown table in the generated documentation. This ensures the table format is correct and consistent.
The pipeline includes steps to upload various artifacts to the repository if they have changed. This includes documentation files and PlantUML diagrams.
The local Maven repository is cleaned up as part of the pipeline to free up space and ensure a clean build environment.
The CHANGELOG.md file is automatically updated with the latest changes based on commit messages.
The .env file is updated with the latest environment variables required for the project.
The DIRECTORY.md file is generated to provide an overview of the project directory structure.
The swagger.json and swagger.yaml files are generated to provide OpenAPI specifications for the API.
The Java documentation is generated in Markdown format using the Dokka plugin. This documentation is committed to the docs/site directory.
import re
import os
def adjust_markdown_table(input_file, output_file):
with open(input_file, 'r', encoding='utf-8') as file:
lines = file.readlines()
table_start = False
adjusted_lines = []
for line in lines:
if '| Name |' in line:
adjusted_lines.append('| Name | Description |\n')
adjusted_lines.append('|---|---|\n')
table_start = True
elif table_start and '|---|' in line:
continue
elif table_start:
match = re.match(r'\|\s*\[(.*)\]\((.*)\)\s*\|\s*(.*)\|?', line)
if match:
name = match.group(1)
link = match.group(2)
description = match.group(3).strip() if match.group(3) else ''
adjusted_line = f"| [{name}]({link}) | {description} |\n"
adjusted_lines.append(adjusted_line)
else:
if line.strip() == '':
table_start = False
adjusted_lines.append(line)
else:
adjusted_lines.append(line)
with open(output_file, 'w', encoding='utf-8') as file:
file.writelines(adjusted_lines)
print(f"Markdown table adjusted and saved to {output_file}")
docs_path = 'docs/site'
input_md = os.path.join(docs_path, 'index.md')
temp_md = os.path.join(docs_path, 'index2.md')
os.rename(input_md, temp_md)
print(f"Renamed {input_md} to {temp_md}")
adjust_markdown_table(temp_md, input_md)
os.remove(temp_md)
print(f"Deleted temporary file {temp_md}")- Overview: Presentation of the project, highlighting its purpose and the context in which it is embedded.
- Project Objectives: Enumeration of the main objectives that the project aims to achieve.
- Scope and Functionalities: Description of the main functionalities offered by the project and its scope of operation.
- Initial Configurations: Steps required to set up the development or production environment.
- Installation Instructions: Detailed procedures for installing the project in different environments.
- Docker Configuration: Specifications on how to configure and use Docker for the project.
- Folder Structure: Description of the organization of the project directories.
- Project Architecture: Explanation of the architecture used, including design patterns and technical decisions.
- Development Flow: Description of the development process adopted, including planning, coding, and review stages.
- Apache Camel Integration: Guide on integrating Apache Camel into the project, including configuration and usage.
- Contributors and Authors: Recognition of the contributors to the project.
- Contributions: Guidelines on how to contribute to the project, including code standards and pull request requirements, tips and best practices.
- Code of Conduct: Behavioral guidelines expected for the project community.
- OpenAPI Specification: Details about the OpenAPI specification used to document the API endpoints.
- API Documentation with Swagger: Information on how to access and use the interactive API documentation generated by Swagger.
- Javadoc Documentation: Information on the Javadoc documentation generated for the project.
- Endpoint Description: Details of the available API endpoints, including methods, parameters, and usage examples.
- Database Management: Strategies and practices for efficient management of the database used by the project.
- Testing Strategies: Approach and methods used to test the software, including unit, integration, and E2E tests.
- Testing Tools: Description of the testing tools used in the project and how to configure them.
- CI/CD Pipeline: Explanation of the continuous integration and delivery pipeline, detailing each stage and its function.
- Automations and Artifact Generation.
- .gitignore, .editorconfig and project.properties: Utility of these files to maintain code consistency and quality.
- Maven Wrapper and application.properties: Explanation of how these files help standardize the development environment.
- .env File and Travis CI Settings: Use of these files to configure the environment and CI integrations.
- Code Standards and Security: Guidelines for maintaining code quality and security.
- Monitoring and Logging Practices: Recommended techniques for monitoring and logging in the project.
- Licensing: Information about the rights and restrictions associated with the use of the software.
- Terms of Use: Information about the terms and conditions for using the software.
- Future Plans: Discussion on functionalities and improvements considered for future versions of the project.
- Improvement Proposals: Space for the community to suggest and debate improvements and innovations.
- External Links and References: Additional resources and external documentation relevant to the project.
- Security Policy: Details on the supported versions, reporting vulnerabilities, and general security practices.