Where do i see bitbucket-pipelines.yml after configuring it? - bitbucket

I have configured bitbucket-pipelines.yml, but i can't find the window i was configuring it with.
If i go to the Deployments menu on bitbucket, i see the following picture and i have no option of changing my pipeline anymore. It just says: Deployment tracking with Bitbucket.
How am i able to change the pipeline again?
In another repository, which i have not configured yet, this screen loads and i am able to configure my bitbucket pipeline.

I got this answer from the support, if anyone is interested:
Where does the bitbucket-pipelines.yml file reside ?
You will be able to see the bitbucket-pipelines.yml file on the main branch once pipelines is enabled on your repository
How do I know pipelies is enabled and how can I enable it ?
You can find the pipelines settings by accessing the repository settings > Pipelines > Toggle to enable pipelines
Other ways to access bitbucket-pipelines.yml ?
You can access it from the repository source section:
You can go to a build and click on the GEAR icon next to the build it will redirect you to the pipelines.yml page
You can navigate to the commit that recorded the change to the Bitbucket-pipelines.yml file, this will have a link to the YML file

Related

Jenkins, Build when a change is pushed to BitBucket, multiple job

I have a problem with "Build when a change is pushed to BitBucket" setup on my Jenkins.
So I've configured two repositories, to start their own pipelines if someone push a commit and the push part is working, but when I create a push on repo1, it will start repo1_pipeline and repo2 pipeline.
Structure:
repo1 > repo1_pipeline
repo2 > repo2_pipeline
My url on bitbucket side (both cases): https://jenkins-url.com/bitbucket-hook/
Jenkins side:
Jenkins setup
Someone one can u explain this for me?
Thank you,
By default the Plugin will loosely match the Repository and the Job based on the SCM configurations you have. Following is from the plugin document.
The "loose matching" is based on the host name and paths of the
projects matching.
You can try specifying your full repository URL as the Override Repository URL or Path.
As an alternative, you can consider using the Generic Webhook Trigger Plugin. You can read this answer for more details.

HTTP ERROR 403 No valid crumb was included in the request error with GitLab+Jenkins on windows environment

I know the similar question has been asked many time before. I am trying to integarte GitLab with Jenkins through webhook and have an error as mentioned in title. I found the answer as well as per my situation which is listed here
Gitlab+Jenkins through webhook it shows this error, how can I solve this?.
The thing which is not understanable for me right now is as per the suggested solution
For me the URL for webhook what I saw was wrong. It was https://JENKINS_URL/job/YOUR_JOB it should be https://JENKINS_URL/project/YOUR_JOB, changing the job to project solved my issue
I am not able to find a way that how I can change job URL from https://JENKINS_URL/job/YOUR_JOB to https://JENKINS_URL/project/YOUR_JOB within Jenkins to build job URL as per GitLab webhook settings.
Any help will be much appreciated. Thanks
Update - My Jenkins server is configured with URL http://JENKINS_URL:8080/
trying
login to jenkins > Manage Jenkins > Configure System
in here, config your server jenkins
after back to Dashboard > New Item > Freestyle project.
In Build Triggers, select Build when a change is pushed to GitLab. GitLab webhook URL: X
after Advanced > Secret Token > Generate. you have key Y
login to gitlab, open your project.
in your project click Settings choose Webhooks.
paste X, Y in your config jenkins to here.
click Test if gitlab noti:
you are success!!!
You don't need to reconfigure your Jenkins instance. What you should do is the following:
Go to the Jenkins project you want to use;
Go to Configure -> Build triggers section;
See the name of the checkbox Build when a change is pushed to GitLab. GitLab webhook URL: <TARGET URL>
What you're looking for is the "TARGET URL" from step 3. See the screenshot for an example of such an URL. As you can see it has the needed project format:

Unable to create Build on Docker Hub from GitHub

I just created a new account on hub.docker.com. I successfully linked my GitHub account in settings. After I clicked on Create Repository, I am presented with the familiar screen, where I can create a new docker repository. However, the first strange thing here I noticed is, that I don't have the additional build options.
This is what is missing:
I went on and created a blank repository. After that I went to the builds tab and clicked on the GitHub button, which said I was connected:
In the following screen, I can select the the desired repository. After filling out the remainder of the form, nothing happens after I click Save or Save and Build.
I do not see any error messages popping up either.
Any ideas what I am doing wrong with this newly created docker account?
Thank you very much for your time and help!
For GitHub, I'd recommend this guide for setting up a connection with GitHub Actions and Docker.
I've only set up a connection with BitBucket and Docker, but I'll share the process with BitBucket for anyone else searching, or in case that provides any additional insight that might help with GitHub.
In BitBucket, you need to set up a pipeline to push the build to the repo. The docs here outline the process.
A quick summary of the steps in BitBucket:
Go to your repo in bit bucket
Click on pipelines and add the Docker template
Update the image name in the yml template
Commit the yml to the repo
Set up the variables in the repository settings in BitBucket for your credentials and repo slug
Check the status of your build in the pipelines tab, it should automatically rebuild up update.

I have gitlab repository, under one repository I have many projects. Now I want to intergrate gitlab with Jenkins

I have gitlab repository, under one repository I have many projects. Now I want to intergrate gitlab with Jenkins . So normllay when ever a commit happen in git repo the solution file in the repository should build.
But in my case if I integrate with Jenkins I have many solutions files in same repository.so I want to trigger only the solution file which is related to the commited file.
Is their any way by using webhook (or any way ) to know what folder of the repository is modified ? So that I can run related solution file based on the path
Folder structure:
Project1/project1.sln and dependent files
Project2/project2.sln and dependent files
Thanks in advance.and also please guide for githab webhook configuration to integrate with Jenkins .
GitLab Webhooks can be created in the GitLab Web-Interface. The modified files are listed in the body of the Push-Message.
Solution with the Git Plugin
Create a Freestyle Job for one solution file e.g. Project1
Go to Build Trigges
Select Poll SCM.
Leave Schedule empty
Go to Source-Code-Management
Select Git
Configure Repository URL and Credentials
Enter Branch e.g. refs/heads/master
Select Repository Browser (AUTO)
At Additional Behaviours press Add Button the bottom
Select Polling ignores commits in certain Paths
Fill Included Regions with the path to the project folder e.g. ^Project1/*.. That means it will only trigger the build if changes in that folder or it's subfolders are detected.
Go to Post-Build Actions at the bottom of the job configuration and press Add Button
Select Clean Workspace after Build
Add Patterns for files to be deleted press Add Button
Select Exclude
Enter **/.git/*
Select Checkbox Apply pattern also on directories
When GitLab sends a Push Message, Jenkins will trigger SCM polling of this job. It will verify if there are changes in the related folder. Build will start if this is the case.
You can check the git polling protocol at /job//scmPollLog/
Solution with the GitLab Plugin
The Jenkins GitLab Plugin would also be a solution.

how can i push code in to jenkins and it will automatically deploy code in to github in it possible?

I am new to jenkin's but what i am looking for is as below
1.How to create project or how to push your code in to jenkin's?
2.How it will directly push this code into github's branch?
I have followed some tutorial but nothing is clear.
Please help me.
Jenkins is not a repository, Jenkins is just a CI tool, basically build server, you cannot "store" codes in Jenkins, but yes, it is able to pull codes from repositories and eg. build it. (or push artifact- war/jar/ whatever to some machine via ssh eg.- look for publish over ssh plugin for this)
Create eg. freestyle project, and then take a look into "Source code management" section, there you can choose git, github, svn, whatever.. Will fill credentials and repo URL, then in "Build" step you will choose what you need to do.
For build check this
If you really mean how to push the changes back to repository, than I have found this- its done with git plugin.
I am not sure, but either you didnt understood what the jenkins is for, or you are using not proper name convetions. Hope that helps.
We found this solution works
It uses Add post-build action ⇒ Git Publisher

Resources