Deploy static reports using CI/CD systems
CI/CD systems play a crucial role in the software development process, which automates the construction, testing and deployment processes, thereby improving development efficiency and software quality. Among them, it is very common to generate static reporting websites during the construction process, which include unit test results, static analysis data, and various useful metrics. This article aims to describe how to integrate these static reporting sites into the CI/CD process so that team members can easily view and analyze.
As mentioned earlier, this article describes how to deploy a static reporting website generated by the build process in a CI/CD system. We will use Bamboo as an example to explore how to deploy build products to remote servers using Bamboo Deployments and SCP Task and access these reports through a web browser without manual download. This article provides a simple and effective solution to help developers integrate static reporting displays in CI/CD processes.
Steps to deploy static reports
Here are the steps to deploy static reports in Bamboo:
Confirm static content as a build product: Make sure that your static website content (HTML, CSS, JavaScript, JSON, etc.) is packaged as one or more build products (artifacts) after the build process is completed. This is the basis for subsequent deployment.
Create a Bamboo Deployment Project: Create a new Deployment Project in Bamboo. Deployment projects are designed to manage deployment processes and can deploy build products to different environments.
-
Configure Bamboo Deployment Task: Add one or more tasks to the Deployment project. Commonly used Tasks include:
-
SCP Task (Secure Copy Task): Used to securely copy build products from a Bamboo server to a remote server. You need to configure the following parameters:
- Host: The address of the remote server.
- Username: The username of the remote server.
- Password/SSH Key: Password or SSH key used for authentication. SSH keys are recommended because it is more secure.
- Source Path: The path to build the product on the Bamboo server.
- Destination Path: A directory on a remote server that stores static website content, such as /var/www/html or /usr/share/nginx/html. The specific path depends on your web server configuration.
-
SSH Task (Secure Shell Task): Used to execute commands on a remote server. This is useful in the following situations:
- Unzip the build product: If your static website content is packaged as ZIP or TAR files, you can use SSH Task to unzip these files on the remote server. For example, use the unzip or tar -xvf command.
- Restart the Web Server: After the deployment is complete, you may need to restart the Web Server for the changes to take effect. For example, use the sudo systemctl restart apache2 or the sudo systemctl restart nginx command.
Artifact Download Task: If the deployment plan is not on the same server on the build plan, you need to use this task to download the build plan generated artifacts.
-
Configure deployment triggers: Set the triggers to automatically trigger the deployment after a successful build. You can configure the "after successful build" trigger so that the Deployment project will run automatically after each successful build, deploying static website content to the remote server.
Configure a Web Server: Make sure your Web server (such as Apache or Nginx) is properly configured to provide static website content. You need to configure a virtual host or server block to point the domain name or IP address to the directory you specified in the Destination Path.
Sample configuration
Here is a simplified example of Bamboo Deployment Task configuration:
SCP Task:
- Task Description: Copy static website to remote server
- Host: your_server_ip
- Username: your_username
- SSH Key: path/to/your/ssh/private/key
- Source Path: ${bamboo.results.artifact.static_website.path} (assuming your build product is named static_website)
- Destination Path: /var/www/html/your_report
SSH Task:
- Task Description: Unzip static website
- Host: your_server_ip
- Username: your_username
- SSH Key: path/to/your/ssh/private/key
- Command: unzip /var/www/html/your_report/static_website.zip -d /var/www/html/your_report
Things to note
- Security: It is highly recommended to use an SSH key for authentication, not a password. Passwords are easily leaked, while SSH keys are more secure.
- Permissions: Ensure that the directories on the remote server have the correct permissions so that the web server can access these files.
- Error handling: Add error handling mechanisms such as logging and alerts to the Deployment Task so that problems can be discovered and resolved in a timely manner when deployment fails.
- Version Control: Consider using a version control system (such as Git) to manage your static website content. This allows easy rollback to previous versions and tracking the change history.
- Server Configuration: Make sure your web server is configured correctly and can provide static website content. Check the configuration of the virtual host or server block to make sure the domain name or IP address points to the correct directory.
Summarize
By using Bamboo Deployments and SCP Task, you can easily deploy static report sites generated by the build process to a remote server and integrate these reports in the CI/CD process. This can improve team members’ collaboration efficiency and help them better understand build results and software quality. Remember that security, permissions, and error handling are key points that need special attention during deployment. With reasonable configuration and monitoring, you can build a stable and reliable static reporting deployment process.
The above is the detailed content of Deploy static reports using CI/CD systems. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Thenameattributeinaninputtagisusedtoidentifytheinputwhentheformissubmitted;itservesasthekeyinthekey-valuepairsenttotheserver,wheretheuser'sinputisthevalue.1.Whenaformissubmitted,thenameattributebecomesthekeyandtheinputvaluebecomesthevalueinthedatasen

To get started with HTML quickly, you only need to master a few basic tags to build a web skeleton. 1. The page structure is essential, and, which is the root element, contains meta information, and is the content display area. 2. Use the title. The higher the level, the smaller the number. Use tags to segment the text to avoid skipping the level. 3. The link uses tags and matches the href attributes, and the image uses tags and contains src and alt attributes. 4. The list is divided into unordered lists and ordered lists. Each entry is represented and must be nested in the list. 5. Beginners don’t have to force memorize all tags. It is more efficient to write and check them while you are writing. Master the structure, text, links, pictures and lists to create basic web pages.

❌Youcannotnesttagsinsideanothertagbecauseit’sinvalidHTML;browsersautomaticallyclosethefirstbeforeopeningthenext,resultinginseparateparagraphs.✅Instead,useinlineelementslike,,orforstylingwithinaparagraph,orblockcontainerslikeortogroupmultipleparagraph

Using tags is the easiest and recommended method. The syntax is suitable for modern browsers to embed PDF directly; 2. Using tags can provide better control and backup content support, syntax is, and provides download links in tags as backup solutions when they are not supported; 3. It can be embedded through Google DocsViewer, but it is not recommended to use widely due to privacy and performance issues; 4. In order to improve the user experience, appropriate heights should be set, responsive sizes (such as height: 80vh) and PDF download links should be provided so that users can download and view them themselves.

To create an HTML unordered list, you need to use a tag to define a list container. Each list item is wrapped with a tag, and the browser will automatically add bullets; 1. Create a list with a tag; 2. Each list item is defined with a tag; 3. The browser automatically generates default dot symbols; 4. Sublists can be implemented through nesting; 5. Use the list-style-type attribute of CSS to modify the symbol style, such as disc, circle, square, or none; use these tags correctly to generate a standard unordered list.

ThecontenteditableattributemakesanyHTMLelementeditablebyaddingcontenteditable="true",allowinguserstodirectlymodifycontentinthebrowser.2.Itiscommonlyusedinrichtexteditors,note-takingapps,andin-placeeditinginterfaces,supportingelementslikediv

To add an icon to the website title bar, you need to link a favicon file in part of the HTML. The specific steps are as follows: 1. Prepare a 16x16 or 32x32 pixel icon file. It is recommended to use favicon.ico to name it and place it in the website root directory, or use modern formats such as PNG and SVG; 2. Add link tags to HTML, such as PNG or SVG formats, adjust the type attribute accordingly; 3. Optionally add high-resolution icons for mobile devices, such as AppleTouchIcon, and specify different sizes through the sizes attribute; 4. Follow best practices, place the icon in the root directory to ensure automatic detection, clear the browser cache after update, and check the correctness of the file path.

Choosing the right HTMLinput type can improve data accuracy, enhance user experience, and improve usability. 1. Select the corresponding input types according to the data type, such as text, email, tel, number and date, which can automatically checksum and adapt to the keyboard; 2. Use HTML5 to add new types such as url, color, range and search, which can provide a more intuitive interaction method; 3. Use placeholder and required attributes to improve the efficiency and accuracy of form filling, but it should be noted that placeholder cannot replace label.
