bitbucket-pipelines.yml
INFO: Uploading email-service-v1.0.jar to S3.
INFO: Found credentials in environment variables.
Traceback (most recent call last):
File "/pipe.py", line 264, in <module>
pipe.run()
File "/pipe.py", line 254, in run
self.upload_to_s3()
File "/pipe.py", line 230, in upload_to_s3
with open(self.get_variable('ZIP_FILE'), 'rb') as zip_file:
FileNotFoundError: [Errno 2] No such file or directory: 'email-service-v1.0.jar'
Please help me to get out of the problem.
Hi @Rahul Kumar and welcome to the community!
After taking a look at your yml file, I see the following issues:
1. In the first step, the artifacts definition includes an absolute path to the artifact email-service-v1.0.jar
Paths should be relative to the clone directory ( /opt/atlassian/pipelines/agent/build/ ), so you need to change the definition as follows:
artifacts:
- target/email-service-v1.0.jar
2. In the second step, the value of ZIP_FILE is a jar file.
According to the documentation for the pipe, supported file types are: zip, tar, tgz, YAML or JSON. See here:
You can add a command to zip the file email-service-v1.0.jar and then pass this .zip file to the pipe, instead of the .jar
3. The pipe will try to find the file you defined in ZIP_FILE in the clone directory ( /opt/atlassian/pipelines/agent/build/ ).
If you create a zip file for the jar named e.g. email-service-v1.0.zip and this zip exists in the directory /opt/atlassian/pipelines/agent/build/target/, you can adjust the value of ZIP_FILE in the pipe command as follows
ZIP_FILE: 'target/email-service-v1.0.zip'
Please feel free to let me know how it goes and if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.