Skip to content

How to see generated PDF files in Jenkins with the AWS Blu Age Devops Pipeline

0

Hello,

The application we are working on generates PDF files in the following path: workingDir/reports/<subfolder>/<pdf_file>. When testing this application automatically, we would like to see in Jenkins the PDF files that have been generated during the test. Actually, these files are not retrieved by the pipeline and we get the following message: "No PDF file found".

Do you know how we can achieve that?

Thank you in advance.

2 Answers
3
Accepted Answer

Hello,

If you get the log "No PDF file found". It's maybe because your app didn't generate a PDF file. Could you please double check inside the EC2 if the reports folder has been generated?

Here is how to do it:

  1. Connect to ec2-<AWS_REGION>-test-cases
  2. Retrieve the container ID of the tomcat container with the command: docker ps
  3. Then run docker exec -it <CONTAINER_ID> bash
  4. Check in the CATALINA_HOME folder if there's a reports folder

Hope it helps 😊

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

0

To view the generated PDF files in Jenkins when using the AWS Blu Age DevOps Pipeline, you'll need to modify the pipeline configuration to include these files in the artifacts that are collected and stored after the build process.

The issue you're experiencing is likely because the pipeline is not configured to capture and store the PDF files generated in the workingDir/reports/<subfolder> directory.

To resolve this, you should update your pipeline configuration to include these files as artifacts. This typically involves modifying your buildspec.yml file or the relevant Jenkins job configuration.

Here's a general approach you can take:

  1. Locate your buildspec.yml file or the Jenkins job configuration that defines your build process.

  2. Add a step to copy or move the generated PDF files to a location that is included in the artifacts collection process.

  3. Update the artifacts section of your configuration to include the directory where the PDF files are located.

For example, you might add a command to copy the PDF files to a specific directory that's already included in your artifacts, or you could modify the artifacts section to explicitly include the workingDir/reports directory.

If you're using AWS CodeBuild as part of your pipeline, you might add something like this to your buildspec.yml:

artifacts:
  files:
    - '**/*'
  name: my-artifact-name
  base-directory: 'workingDir/reports'

This would include all files from the workingDir/reports directory in your build artifacts.

After making these changes, rebuild your pipeline. The PDF files should then be available for viewing in Jenkins after the build process completes.

Remember to adjust the paths and commands according to your specific project structure and requirements. Also, ensure that the IAM roles associated with your build process have the necessary permissions to access and copy these files.

If you continue to face issues, you may need to investigate whether the PDF files are actually being generated in the expected location during the build process, or if there are any permission issues preventing access to these files.
Sources
How to create a folder in Tomcat working directory before running test cases with the AWS Blu Age Devops Pipeline ? | AWS re:Post
Disk space issue for build executor in AWS Blu Age Devops Pipeline | AWS re:Post

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.