Addition of webhooks in Gitlab - jenkins

I want to do automatic build in Jenkins when code gets pushed into the Gitlab.
For the same doing webhooks configuration in Gitlab, but getting error :
Url is blocked: Requests to the local network are not allowed.
Even not able to do the activity mentioned in the image :
I am not able to go to the admin area.

if you have the gitlab server locally
from doc
This behavior can be overridden by enabling the option “Allow requests to the local network from web hooks and services” in the “Outbound requests” section inside the Admin Area > Settings (/admin/application_settings/network):
url to the entire article here

Use the root login and check the outbound option, you should be good.
Let me know if you get any other error.
I had faced the same issue yesterday, but all good now.

Related

Bitbucket Server - How to get the Bitbucket Server instance

I'm new to Bitbucket Server.
Currently, I'm trying to configure a Jenkins job to build my repository, which is located in my personal space of Bitbucket Server (I'm not admin of BitBucket Server).
I followed the video here: https://www.youtube.com/watch?v=0-FugzVYJQU.
Inside Jenkins setting, I have put the URL to my company bitbucket server, personal access token, Credentials as per hint from Video... But the connection still fails.
My question is:
1 - Do I need the admin right of Bitbucket Server to setup these procedures or did I configure something wrong?
2 - If possible, how to get the Bitbucket Server instance when I don't have the
admin right of Bitbucket Server?
Sorry English not my native language.
Thank you for your help :)
Jenkins Setting - Bitbucket Server instances entry
Regarding your question 1,you don't need any admin access to bitbucket server to setup this procedure.If you are cloning from any repository, you need to make sure that the credential you are using, should have at least read access to particular repository.
For your second question, if you are setting up any jenkins job and Bitbucket team is different, you need to ask them for url or IP. Even you dont know ip, bitbucket server URL should be fine to connect with as long you are using correct credentials.
There can be multiple issue like firewall/no connectivity/security rules if jenkins is not able to connect though you are using correct credentials.
1 - Do I need the admin right of Bitbucket Server to set up these
procedures or did I configure something wrong?
You do not need admin rights of Bitbucket Server. You can add your own personal access token(PAT). Make sure your PAT has admin access.
If possible, how to get the Bitbucket Server instance when I don't have the admin right of Bitbucket Server?
You have to configure your Bitbucket instance manually. Its explained from here in the video.
If your repository is in your personal space, make sure while creating a job, the project name is ~<yourusername>. Example ~jsmith. Repository name will be populated using this.
Regards,
Bitbucket Server Developer

Is it possible to use Jenkins Webhooks with Github when the github account uses 2 factor auth

I am using the latest docker image for jenkins (jenkins/jenkins:lts JENKINS_VERSION 2.208). I have started the container, configured jenkins and can manually build against a public repo. However, on my github account I have 2FA, which must remain. I have created a personal access token in Github, and used this in my jenkins config for github server section. I have validated that the connection is working by pressing the test connection link (I added secret text that used my personal access token from github):
In Github, I have wekhook settings with the IP address for where jenkins is hosted (the IP for the docker container) follwed by github-webhook (I have also tried using a dns mapped address for jenkins as well, e.g., http://jenkins-local/github-webhook), content type is application/json:.
I have github polling enabled in jenkins as well, however, it does not work on push requests to the repo. I see failure logs in Github within the webhooks section, this increases each time I make a push (the request keeps failing). I have searched wide across the internet and found documentation of suggestions on what to do, including this link here: securing your webhooks, but nothing is giving me the desired polling effect when a push is initiated and a build triggered. So my question is, is it possible to use 2FA and github webhooks? If it is possible, then what are the exact steps to do it?
If you have 2FA enabled, you cannot authenticate with a login/pass from your tools anymore. You need to create a token that you will use in place of your password.
The official documentation should get you there in almost no time.
In the end the solution was to download ngrok. The IP address that the I had previously tried and the dns mapped address were not publicly available. I tried using my public ip address as well, but that also didn't work. In the end, downloading ngrok gave me a publicly accessible ip address (the address will look like the following: http://1212344a.ngrok.io). If you also plan to use ngrok then ensure that when you start it from the command line/terminal that you also pass the same port for the application that is running locally, if one is required. Next, in github - settings - webhooks set the payload url to the url that ngrok provides in the terminal output, but also append /github-webhook/ on to the end of the address to complete the payload url (in my case this was http://1212344a.ngrok.io/github-webhook/ as the full payload url).

Blue Ocean Pipeline editor doesn't start as can't connect to git

On this tutorial, I am stuck at first page where I am supposed to connect to a Git repository. I have tried Github and Bitbucket. For both when I press ok after inputing my credentials, it waits for a few seconds then nothing happens. Not even an error message. I am sure that my bitbucket credentials are correct.
Any idea why?
By the way, I am behind a proxy, which I have setup as usual in the plugns section. I can download plugins so the proxy is correctly setup.
The tutorial does use an access key, that is a PAT (Personnal Access Token): that means it should net require username/password for GitHub.
Try that (using a key) first.
On BitBucket, the same notion of access token applies.

working with Bitbucket docker image

I am trying to use bitbucket docker image as documented in the below link.
https://bitbucket.org/atlassian/docker-atlassian-bitbucket-server
I progressed to
bring up the container.
hit the url and create admin user.
But it does not log me in.
The message is invalid userId/password.
The reset wont work because being a container, the mail service is not set up.
I cannot proceed past this and it is frustrating.
Any help is appreciated.

Bamboo Bitbucket integration

Bamboo and bitbucket are two pieces from the same vendor and there should be no problem integrating those two with each other, but I have a weird situation.
Here is what i get when trying to add bitbucket repo to my Bamboo.
See attached screenshot.
I'm pretty sure my repo is public and I use correct bitbucket user account name.
Thanks in advance.
I have installed BAMBOO to AWS using Java script provided by Atlassian
At the end it gave me a web UI links as on following screenshot .
It worked, however some functionality was blocked by XSRF (that is not enabled by default in Atlassian products).
Works fine when I use native Bamboo URL (HTTP and port 8085) instead on HTTPS.
Be careful with that... I just wasted about 2 days trying to fix something that didn't have to be fixed at all.
Have you linked your Bitbucket repo to Bamboo server. If not see this https://confluence.atlassian.com/bamboo/linking-to-another-application-360677713.html
May be this can help.

Resources