how teamcity automatically building Pull Requests from GitHub? - teamcity

TeamCity Documentation states:
In the version control settings of the config, make the branch specification:
+:refs/pull/*/merge
But in my VCS Root Card, there is no section named "Branch specification", what should i do ?
Here is my current configuration screen

In order to setup the Branch specification parameter, you need to click on "Show advanced options" at the bottom of the config screen (just above the save button)
Inside this textarea, you can set: +:refs/pull/*/merge

Related

TeamCity: revert overriden steps

Situation: we have a set of build configurations based on the same build template. So, all the configs are marked as "based on MySuperTemplate" and all build steps are marked as (inherited). So far so good.
Eventually I introduced a change in a step of a particular build config, not in the template itself. After figuring this out, I applied the change to the template, however corresponding step of that particular build config is still marked as (inherited, overridden).
Question: how to undo that "override state" back to "just inherited" so the step will accept all the changes from the template origin again?
P.S. TeamCity version is 2021.2.3 (build 99711) if it matters...
No idea why I didn't notice it before:
Open the build configuration, go to the grid of steps
At a grid row with "overridden" step, find "Edit" hotlink accompanied with a small combo-button aside (right-side of the row)
Open a drop-down for this combo-button and click "Reset" option (it appears for overridden steps only, regular ones are provided with "copy" and "disable" choices)
As simple as that. Now the step is reverted back to the template-defined content.

How to checkout a tag using TortoiseGit in an empty directory on you local PC?

My machine is Windows 7 operating system. The Git version is 2.23.windows.1. I have TortoiseGit 2.8.0.0 version.
There is a remote repository on BitBucket. It has many tags one of them is v1.5.
On my local PC there is an empty directory. In it I want to checkout the v1.5 tag using TortoiseGit. How can I do that?
I know how to do it in case of SVN as each tag has a different URL so TortoiseSVN is pretty easy in such a case but how to do it in Git using TortoiseGit?
From the TortoiseGit Manual, you can open the "Switch/Checkout" dialog by right-clicking on the repository's folder and clicking "Switch/Checkout...", then selecting the "Tag" radio button and selecting your tag (in this case, v1.5).
If you just need the source code of a specific version and no further version conrol locally, you can easily download the source code of a tag directly on BitBucket/GitHub/GitLab. For this go to releases and there you will find the download links.
Using TortoiseGit you first have to clone the repository (open the context menu, select "Git Clone" and enter the URL of the repo, cf. https://tortoisegit.org/docs/tortoisegit/tgit-dug-clone.html). After that, you have to check out the specific version. For this open the "Switch/Checkout" dialog (from the contextmenu, cf. https://tortoisegit.org/docs/tortoisegit/tgit-dug-checkout.html) and select the tag you need.
Technical detail: In Git you cannot check out a tag. You can check out a specific commit, but then it is hard to do further work (this state is called "detached HEAD"). It is better to create a branch for a tag and check out this (this is what TortoiseGit does by default unless you uncheck the "Create new branch" checkbox).

How to set the build branch in teamCity

I'm using perforce in my project. I would like to ask, how can I set the build branch in teamcity? Right now if I want to make a build it is taking code from trunk, when I hit the "run" button it is asking me for my username/password/perforce job, I also need to ask me for a branch name. I know that is needs to be set in the build configuration in build parameters.
I'd suggest using the "Run Custom Build" button to achieve it. It's located next to the "Run" button and titled with ellipsis (three dots in a row).
I might be mistaken in case of the particular VCS you're using (Perforce) though, but for me it works pretty good. When you run a custom build you can either specify the value of your %BranchName% parameter (needs to be specified in your VCS' settings) in "Parameters" tab or select a branch in "Changes" tab.
Hope this helps.

Add existing project to BitBucket using Xcode

I keep getting an error when I try to commit my project files using Xcode.
File -> Source Control -> Commit
"The operation could not be performed because no valid working copies were found."
"Please verify that your files are under source control and try again."
This is an existing project that is NOT under source control. How do I get my project files under source control, using Xcode?
EDIT: Answered my own question.
Step 1) Restart Xcode
Step 2) Choose connect to repo
Step 3) Enter repo address
Step 4) Choose existing project folder you wish to place under version control
Step 5) Voila! :)
Since a lot of folks land here when they google "Add existing project to BitBucket using Xcode" and then click through to the link that goes to my blog post on the subject, I thought I would put the information here (in the spirit of SO which discourages link only answers.)
NOTE: These instructions assume you have already made a local git repository for the project. You may have done this at project creation. If not, you will need to create the local git now. See this StackOverflow post for how to do that: https://stackoverflow.com/questions/19495141/add-local-repo-for-existing-xcode-5-project
For Xcode 9 and the new Beta UI for Bitbucket:
Log into your BitBucket Account on their web site.
Click the Create button (plus sign + in the newest version of the web UI). And click Repository.
Give your new repository a name. Additional features for the repo can be configured under the Advanced menu. Make sure the check mark for Private is on if you desire that. Verify that the repository type is Git. If desired, add issue tracking, and a Wiki. Select Objective C or Swift from the language drop down. Then Create Repository.
Next, you will want to add your code. On the top of the Overview page is a field with the HTTPS URL of your project. It will look something like this: https://johndoe#bitbucket.org/xyzteam/xyzapp.git. Highlight and copy that URL text.
Run Xcode and load your project.
From the left pane in Xcode, select the Source Control Navigator. Expand the project node. Right click the Remotes node under your project. Select “Add Existing Remote…”
Give it a remote name, such as Bitbucket. Paste the URL from step 4 into the Location. Click Add. It should now appear as a Remote location in the Source Control navigator.
Once your remote has been added, you should now be able to push to the remote. Select Source Control/Push… It should show your Bitbucket remote as the destination and will show (Create) as this is the first push. Click Push.
If this is the first time you are pushing this project to BitBucket, you will be asked for login credentials. The User Name will be prefilled from the URL, so enter the password. Click Okay and after some seconds, it should complete.
If all goes well, you now have the repositories linked up. Go to the BitBucket site, select your repo and you should see the code.
For Xcode older than version 9 and the old Bitbucket UI:
Log into your BitBucket Account on their web site.
Click the Create button.
Give your new repository a name, a description, and make sure the check mark for Private is on if you desire that. Verify that the repository type is Git. If desired, add issue tracking, and a Wiki. Select Objective C or Swift from the language drop down. Then Create it.
Next, you will want to add your code. I am assuming you have an existing project. On the page, you will select “I have an existing project” link from the Command line section.
You will see instructions for linking your local git repository to the remote. There is no need to follow those instructions. However, you will see an https url listed. It will look something like this: https://johndoe#bitbucket.org/xyzteam/xyzapp.git. Highlight and copy that URL text.
Run Xcode and load your project.
From the main menu, select Source Control. Under the gray “Working Copy” item, you will see a menu with your local git repo name and the currently active branch. Expand this menu and you will see an option to Configure [Your project]…. Select this.
Select the Remotes pane from this screen. At the bottom, click the plus +. Select Add Remote…
Now you need a name and a URL. For the name, typically just use your project name, then paste the URL copied earlier in step 5. Some people have found that they must remove the user name portion of the URL. Per the example, remove “johndoe#”. This may have to do with whether your project is set up as a team project, or an individual project.
Click Add Remote. Click Done.
Once your remote has been added, you should now be able to push to the remote. Select Source Control/Push…. If this is the first time you are pushing this project to BitBucket, you may be asked about keychain access and/or login credentials. Enter the appropriate responses, such as Allow for keychain. If you have already done this before, it will simply use the keychain data without further prompting.
If all goes well, you now have the repositories linked up. Go to the BitBucket site, select your repo and you should see the code.
If you want to see a version of this information with screen shots, see my blog post.
Login your bit bucket account and Create a repository in your account
open terminal run these following command
1- cd /path/to/your/repo
2- git remote add origin <url of your repository >
3- git push -f origin master
it works for me, Thanks.

Change Jenkins default view

I have been trying to follow the instructions on how to change the default view in Jenkins here.
I've created another view that I would like to be the default, but when I go looking for the Default View setting in Manage Jenkins -> Configure System it doesn't seem to be there. Is there something I have to do to make it show up? Or is it tucked away somewhere else?
If someone has it working can they indicate where about in the config screen (immediately before/after something else) so I can double check.
I am using Jenkins 1.447
from comment> When I go to Manage Jenkins -> Configure System and Default View, all our "public" views are listed there in the drop down.
Make sure the view you created isn't just in "My Views" for your user, and is open to everyone.
"Manage Jenkins" > "Configure System" >
The default view option is just after the "SCM checkout retry count" and before "enable security"
See below:
You should not have to change anything to have it show up. You might need more than one view, but it seems you have already created another one...
You can only choose between default views when you have more than one view. So first, create a new view by clicking the '+' mark on the Jenkins dashboard:
Of course, the '+' will only appear if you have permission to create new views.
Now, navigate to Manage Jenkins > Configure System. The Default View option appears. Using this you can select the default view.
The above applies to Jenkins 1.536.
To change the default view in Jenkins go to Jenkins Dashboard:
Select Manage Jenkins --> Configure System --> Default view
Default view will be available after SCM checkout retry count in MAVEN Project Configuration .
Select your applicable View and Save and you're done.

Resources