Dockerhub automated build: BitBucket repository with private submodules - docker

I have a private BitBucket repository that stores my Dockerfile. This repository has two other private BitBucket repositories as git submodules. I setup an automated build process on Docker hub and added the public SSH key to my three private repositories on BitBucket. However, when the build runs, it successfully connects to the main private repository on BitBucket but fails when trying to get the submodules. I see the following error in the log file:
fatal: could not read Username for 'https://bitbucket.org': No such device or address
It seems like the build agent is trying to access the submodules via HTTPS, and obviously, fails as there is no web access setup.
Am I missing something or is it a limitation that I'll have to live with for the moment?

I figured it out. My .gitmodules had an HTTPS URL for that particular repository. I edited the .gitmodules file and changed the URL to SSH. Seems like it is building now :-)

Related

Jenkins time out on private Bower repository

We had a bower registry on git hub. The Jenkins job been configured and the build was successful. Recently, we set up a bower private repository. When I trigger the build on Jenkins, its referring to all the url of the private bower repository but getting "Timed Out" and thereby, results in build failure.
Will changing registry to https or https-proxy in .bowerrc make the build successful? What's the resolution?
If it is a private repository, chances are it is internal to your network, therefore you should not use any proxy. (you could try to unset it in .bowerrc)
Im sure you already checked the documentation but just in case https://bower.io/docs/config/#placement--order

Apache Nifi-registry BitBucket repository?

I am looking for version control repository in BitBucket like GitHub. I have found Nifi Git repository. But at my organization we have private account in BitBucket. My question is can I create version control repository with Apache Nifi-registry in bitbucket? There is a class (org.apache.nifi.registry.provider.flow.git.GitFlowPersistenceProvider) which is associated with Git in the providers.xml file in nifi-registry. For bitbucket which class should i use? any help, guidelines will be greatly appreciated. Thanks!
It shouldn't matter where the remote git repo is located, so it should work with BitBucket just like it does with GitHub. You would clone the repo from BitBucket to the server where NiFi Registry is running, and then configure providers.xml to use the local cloned repo, and enter credentials to enable pushing to remote.
It should work the same as how you would interact with the git repo from the command line. You add or modify files in the local repo, commit them, then push to remote. In this case, all these steps will be done by registry for you.

Jenkins failing to clone Bitbucket links during Rspec Puppet unit tests

I'm trying to set up a Jenkins build to clone a Bitbucket link and run unit tests I've written against some Puppet modules. I've got Jenkins set up with an SSH keypair and have verified that it can clone the Bitbucket repository initially, but when the unit tests run and clone separate modules as part of the test, I get an error that the public key does not work.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I've verified that the build is running under the Jenkins user and that the keys are in the .ssh directory, what else can I try to fix it?
I was able to fix it by logging into the Jenkins Docker instance and using the SSH keypair from there instead of the one on the Jenkins server hosting the instance. It worked completely after I did this.

Git plugin for Jenkins doesn't work with BitBucket repository

I have a project on bitbucket with git repository.
I want Jenkins job that pulls stuff from that repository. So I installed the Git Plugin.
I configure My Jenkins job to use git repository. I add credentials I use on BitBucket. Then I enter repository URL like this:
https://PawelRoman#bitbucket.org/PawelRoman/myproject.git
I'm getting the following error in red:
Failed to connect to repository : Failed to connect to https://PawelRoman#bitbucket.org/PawelRoman/myproject.git using credentials PawelRoman on BitBucket (status = 401)
401 seems like an authorization issue, but what can possibly be wrong? When I run git clone command manually from the server where I have Jenkins installed, using exactly the same repo URL and exactly the same credentials - it works without any issue. I am 100% sure the credentials are OK and repository URL is fine. How can I track down the cause of the issue?
Found out what the issue was. Repository URL was incorrect. For some reason jenkins git plugin does not allow for Username# in the repository URL.
So instead of https://PawelRoman#bitbucket.org/PawelRoman/myproject.git
You need to use
https://bitbucket.org/PawelRoman/myproject.git
And it will work.
User this url to get the project from the bitbucket
https://<user>:<pass>#bitbucket.org/<user>/<project>.git

Will my private github repo code become public if I use Docker automated build?

When I wanted to configure the Github webhook for Docker automated builds I got warning:
"Only add to PUBLIC repo, otherwise Private code will end up on the public Docker index".
From the other side, when I go to docker documentation it says:
During the build process, Docker will copy the contents of your Dockerfile. It will also add it to the Docker Hub for the Docker community (for public repos) or approved team members/orgs (for private repos) to see on the repository page.
So which statment shall I rely on? I have private Github repository and private Docker repository as automated build. If I enable webhook will any of my code get exposed?
UPDATE AND FINAL RESULT:
After some discussion with github support the update to Docker webhook documentation was made:
github-services:90ae97f.
It is safe to link private github repo with private docker repo.
Docker.com gives a single free private repository you can use with an automated build with a private repo on Github or bitbucket. I have not tested this with Github, but currently have a build linked with Bitbucket and it does work.
Make sure you are using a private repo on docker.com though.
edit We have updated the text to give better information and eliminate this confusion. Thanks for raising the issue. https://github.com/github/github-services/pull/946
Old Text
It shouldn't. The text on GitHub is left over from before our private repository service. Now if you make your repo private, your automated build will be private.--

Resources