Hi,
I've uploaded a settings.xml file to the repository Downloads area. I'd like to specify that with a -s option in a Pipeline. There's a post recommending a cp command to bring the file in the workspace.
Is there an environment variable or path that I can use to find the file? I get a "no such file" when I try the suggested path (starting w. /opt/atlassian).
Thanks,
Carl
Hi Carl,
When you say you've uploaded a file to the repository Downloads are. Do you mean the downloads section (listed in the sidebar)?
If so, these aren't copied into your pipelines. Only the repository itself. You need to manually download these. You can have a look a the REST API docs for how to do this: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/downloads/%7Bfilename%7D
If you don't mean that, can you clarify what you mean by "repository Downloads area"?
Can you also include your bitbucket-pipelines.yml for additional context?
An additional debugging trick you could try is:
ls -Rhl ~ | grep settings.xml # This will check to see if the file exists.
Just for some extra information: There's a default environment variable called BITBUCKET_CLONE_DIR which points at /opt/atlassian/pipelines/agent/build. However that's the directory you seem to be using already, so don't need to do anything.
Thanks,
Phil
Hi Phil,
Associated with a BitBucket Repository, there is a Downloads tab (your screenshot) which takes you to a Downloads page. I've uploaded a settings.xml to this page that I would like to use in my build. I would also like to upload a code signing cert.
I don't want to store the settings.xml or the cert in the repository itself as they contain credentials.
In Jenkins, I'm using "Settings file in filesystem" in the build definition and WebDAV to maintain the artifact. It sounds like I'll need to issue a curl call prior to issuing any Maven commands in my YAML.
Thanks,
Carl
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The REST API suggested by Phil is working for me. I have my settings.xml file uploaded to Downloads in the Repository (but not checked into the source code). I'm using masked environment variables to hold the account information needed for the curl: BB_USER, BB_PASS.
My mvn uses the file downloaded in a curl step like this
- curl --user $BB_USER:$BB_PASS -o settings-demo.xml -L https://api.bitbucket.org/2.0/repositories/MYORG/demo-repo/downloads/settings-demo.xml
- mvn -B -s settings-demo.xml verify # -B batch mode makes Maven less verbose
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.