In TeamCity is it possible to navigate your projects source code? - teamcity

Does anyone know of a way to view entire source of a build via TeamCity - Jenkins has a nice feature whereby you can get to the workspace really easily. Hope this is possible out-of-the-box or via some other method.
Thanks.

I don't know if there is a way to directly get to the source through the Team City interface, but I do know that as you inspect problems, you can get a stack dump. It wouldn't surprise me if you can.
But, I use a different work flow instead, since the CI's working environment should only be a checkout from your source. Therefore if you have your revision information, you can view the source from your repository:
Use the %build.vcs.number.1% property in your "Build Number Format" field; this will place the revision ID into the build's name. You can then view that source exactly in the repository.
You can configure where the checkouts go, but either way you can navigate to "Team City's" working directory if you have access to that box.
You can get the temporary WC directory through the %system.teamcity.build.checkoutDir% property if you want to see the directory on disk where the checkouts etc. happened at.
see this TeamCity article for more information on changing it.
You can turn on VCS Labeling under the VCS Settings, where a build is auto-labeled in your repository. That naming convention is also configurable.
see this blog for more information.
Hope that helps.

Related

How to hide sensitive information from TFS Checkin

I would like to evaluate the performance of a new developer before bringing him on full time. However I would like certain customer names, other sensitive data within our visual studio solution to be "obfuscated" to him so that when he gets latest, etc., he does not see this sensitive information. Is there any way to rename certain strings when he checks code out to make certain strings appear as something else, but make it so that when I check code out these strings are replaced with their actual values?
I am afraid there is not such a feature in TFS.
Alternatively, you can create a new branch. And hide the sensitive information in this branch. Then let the new developer work on this specific branch. See Branch folders and files.
You can also change the security settings to allow the developer to access to this branch only. Go to project Settings-->Version Control(or Repositories) See below:

What is a good learning resource for TFS and how to use TFS with Visual Studio?

What is a good learning resource for TFS and how to use TFS with Visual Studio?
Specifically, I want to know two things.
Exactly what are the step-by-steps procedures of checking in code. I know that I am required to do a code review. So, after the code review is done by a peer, I understand that this is not enough and the original developer has to click to do something to submit the code into the TFS system. I mean, I want to know precisely what buttons to click on.
I also want to know how to use Visual Studio to look up the actual version. How do I determine the details of what is already checked in?
There are many blogs videos in google. If you want a full detail resource, suggest you directly take a look at our official doc here -- Azure DevOps Server Documentation
A suggested learn order for your reference:
Installation (you could skip this if your company already done this)--
Code -- Build&Release -- Packages-- Test-- Work-- Analysis-- Admin
Tool
TFS supports two types of version control: Git and Team Foundation Version Control (TFVC). One centralized and one distributed. As for which version control system should you use, you could take a look at this thread: Choosing the right version control for your project
For your case, you could easy check the history in server side. It's called changeset in TFVC and commit in Git.
For example, when you check in your changes, they are stored on the server as a changeset. Changesets contain the history of each item in version control.
You can view a changeset to see what the exact file changes were, discover the owner's comments, find linked work items, and see if any policy warnings were triggered.
The same as Git, actually you could find the answer for both question 1&2 in Code part. Hope it helps.

How do you configure the location of TeamCity server cache and temp directories?

This blog post indicates that it's possible to re-configure the locations of the $data/system/caches and $server/temp directories in order to optimise a TeamCity installation.
Admittedly the post is a bit outdated; but I've done plenty of searching around and tweaking and can find no direct references on how to do this.
Any help much appreciated.
At the moment the only way is to map the directories to the desired location using OS-specific means (using symlinks). The related ticket in TeamCity bug tracker: TW-15251, please comment/watch it to get status updates.
It seems there's no way to configure those directories locations on the TeamCity side. However, one can make use of OS-provided file system links to map the $data/system/caches and $server/temp directories to other locations, as documentation suggests doing for the artifacts directory ("Recommendations as to choosing Data Directory Location" section here)

xcodebuild says does not contain scheme

I have a curios issue.
I have a project that I've worked on and always built from the XCode IDE, and it worked fine. Now I'm setting up Bamboo to build the project and as such am building it from the command line.
The issue is, if I check my code out of GIT and then use xcodebuild to build it it says that the scheme cannot be found, but if I open the project, it builds and if I then try to build it again from the command line with the same command, it works.
What magic is XCode doing when I open the project or am I doing something dumb, maybe excluding a file in my .gitignore that I shouldn't?
You are definitely on the right track with respect to the .xcscheme file -- I had this problem appear while setting up my own projects!
For posterity, or at least anyone getting here from a search, here are two versions of things -- the "I'm busy, so just the facts please" version and a more involved discussion and rationale. Both of these versions assume you are trying to build from a Workspace file; if you aren't then my apologies as this mostly applicable to workspace-based projects.
Condensed 'Fix-it' Version
The root cause is that the default behavior of Schemes is to keep schemes 'private' until they are specifically marked as shared. In the case of a command-line initiated build, the Xcode UI never runs and the xcoderun tool doesn't have its own cache of Schemes to work with. The goal is to generate, share, and commit the scheme you want Bamboo to run:
On a clean working copy of the code, open your Project's workspace.
Choose Scheme > Manage Schemes... from the Product Menu.
The list of Schemes defined for the project appears.
Locate the Scheme Bamboo is trying to run
Ensure the 'Shared' box is checked for that scheme and that the 'Container' setting is set to the Workspace and not the project file itself.
Click 'OK' to dismiss the Manage Schemes sheet.
A new .xcscheme file has been created in your project at WorkspaceName.xcworkspace/xcshareddata/xcschemes.
Commit this file to your repository and run a Bamboo build.
Deeper Discussion and Rationale
Xcode 4 introduced Workspaces and Schemes as a way to help try and tame some of the chaos that is inherent to dealing with the mechanics of wiring related Xcode projects, build targets, and build configurations together. The workspace itself has its own set of configuration data that describes each of the smaller 'boxes' of data it contains and acts as a skeleton for attaching .xcodeproj files and a set of shared configuration data that gets mirrored to each developer machine or CI system. This is both the power and pitfall of Workspaces -- there are 1) lots of ways in which one can get things configured 100% correctly, but put into the wrong container or 2) put into the correct container, but configured improperly thus rendering data inaccessible by other parts of the system!
The default behavior of Xcode 4 schemes is to automatically generate new schemes as projects are added to the Workspace file. Those of you that have added several .xcodeproj files may have noticed that your scheme list quickly becomes unruly especially as project files are added, then removed, and then readded to the same workspace. All schemes, autogenerated or manually created, default to being 'private' schemes visible only to the current user even when .xcuserdata files are committed with the project's data and configuration. This is the root cause of that cryptic build error Bamboo reports from xcodebuild -- Because Bamboo operates the build through the command line and not the Xcode UI, it doesn't have an opportunity for Schemes to get automatically generated and relies only on those that are defined in the workspace itself. Assuming you've configured Bamboo to build from a workspace using a command like this:
xcodebuild -workspace MyWorkspace.xcworkspace -scheme MyApplication -configuration Debug
xcodebuild goes looking for file <'scheme' Parameter Value>.xcscheme existing at <'workspace' Parameter Value>/xcshareddata/xcschemes.
Obviously there are bunches of ways in which one could configure both Bamboo and a workspace, so keep in mind that your unique configuration may not map 100% to what is presented here. The key takeaways:
Certain automated tasks the Xcode UI magically takes care of are not available via the Xcodebuild CLI.
You can attach scheme and build configuration data to many places in the 'container hierarchy' -- Make sure your data winds up in the right container (Workspace, Project, and/or Build Target)
Consider where in the container hierarchy the xcodebuild tool may be looking for configuration data; a great indicator of where it will start looking is based on the use of '-workspace' or '-project' arguments.
The 'Shared' box is already checked...now what?
I encountered this same issue on my own Bamboo instance; it turned out that the scheme that was committed in my repository was outdated and the latest version of the command line tools wasn't handling it gracefully. Since this existed previously, I took a look through the settings to make sure there wasn't anything glaringly custom about the scheme, deleted and recreated the scheme ensuring that I marked it as 'Shared', and recommitting the new .xcscheme file to the repository.
If everything looks good and rebuilding it doesn't solve the issue, double check that container setting -- it is really easy to get that scheme attached to the wrong container in the hierarchy!
Debug the issue like this:
xcodebuild -list
or if you are using a workspace (e.g. with pods)
xcodebuild -workspace MyProject.xcworkspace -list
If you scheme is not listed fix like so:
Most of the answers would suggest you to make your scheme shared using Xcode, then commit changes to repo. That works, of course, but only if you have access to source code and have rights to commit changes, and couple of other assumptions.
But there's a number of "what ifs" to consider
What if you just can't modify the Xcode project for some reason?
What if you create a new scheme automatically on CI server? This actually happens quite often. If you use test automation framework, like Calabash, you'll normally end up duplicating an existing target, which automatically duplicates a scheme as well, and the new scheme is not shared, even if the original scheme was.
Ruby & xcodeproj gem
I would recommend using xcodeproj Ruby gem.
This is a really cool open source tool that can help you to automate tons of Xcode-related tasks.
Btw, this is the gem used by CocoaPods to mess around with your Xcode projects and workspaces.
So install it
sudo gem install xcodeproj
Then write a simple Ruby script to re-share all the schemes, the gem has recreate_user_schemes method for that purpose
#!/usr/bin/env ruby
require 'xcodeproj'
xcproj = Xcodeproj::Project.open("MyProject.xcodeproj")
xcproj.recreate_user_schemes
xcproj.save
It doesn't just copy scheme files form user's folder to xcshareddata/xcschemes, it also creates those files first by parsing the pbxproj file.
Ok I know its 2 minutes later but I found another stack overflow that says the scheme has to be set to shared... Where does Xcode 4 store Scheme Data?
One common reason for the scheme to be missing is forgetting to push the commits to the origin. If you get a missing scheme message, you should first verify the scheme is shared, then verify you have committed the changes AND pushed them to the origin server.
I had this error while implementing CI.The Question above is identical to my problems except I am using Gitlab's own CI tool.You can check if there is any such file in Bamboo.
I solved it by making some changes to gitlab-ci.yml file.
After you hav made your scheme availabe by sharing. In Xcode Go to Products>Scheme>Manage Scheme and check share to share.
Changes
Set absolute path everywhere.
eg.xcodebuild clean archive -archivePath /path/to/your/project/build/testDemo -scheme testDemo | xcpretty
here you need to change /path/to/your/project/ with your path and testDemo with your project name.
I faced this issue and even if some of the answers here actually provide the solution, I didn't find it very clear. So I will just add one more. In a nutshell how to share a schema from excode.
Navigate to Product > Scheme > Manage Schemes
You will then be shown a list of schemes, with each denoted as being shared or not. Just check the ones that you want to share (it may be different ones for dev and prod builds)
Images taken from this article https://developer.nevercode.io/docs/sharing-ios-project-schemes
Got the same problem but during building with xcode as subproject of main one. Built subproject in xcode standalone - after that this error disappeared.
I want to add solution for my case related to this thread. This one is for you who clone existing project, with all the schemes you need are already being shared:
, with fastlane lanes correctly display all your lanes including all your schemes:
, but fastlane gym only show main schemes (not dev and test schemes):
The solution is to uncheck the shared option for schemes that not listed by fastlane gym and then check it again. It will generates .xcscheme for the schemes:
Now, if you check with fastlane gym, all the schemes will be listed:
Then you should commit those .xcshemes file to the repository, so other developer who clone the project will get the files.
For anyone with Xcode 11.4 trying to find "Shared" button on scheme, it's now moved into the individual scheme.
Select the scheme you want
Press "Edit"
Check the "Shared" box

TortoiseSVN: how to set up projects on a existing directory structure of source code

I have an old pet project I want to revive (haven't had enough time for it last year - small kid - you know) - so restored old copy of my dev folder from archive, but since I have rebuilt my machine since when - I can't remember what needs to be done now. I installed the latest version of TortoiseSVN, and the existing directory structure from my old dev machine looks like:
ProjectName
*SubProject1
**branches
***1.1
***1.2
**tags
**trunk
*SubProject2
**branches
**1.0.3
**1.0.4
**1.0.5
**tags
**trunk
I tried "import project" but it ask for a url - don't know what to specify there ...
can someone post a url to a good TortSVN tutorial - so I could set up my projects quickly (I guess I need to setup SubProject1 and SubProject2) - then I install AnkhSVN for VS2008
and will spend this Sunday coding like crazy while I still have some time ;-)
Rather than focusing on TortoiseSVN specifically, I would actually recommend that you review the SVN documentation first:
http://svnbook.red-bean.com/
A good understanding of what's going on behind the scenes is really helpful when using Tortoise, Ankh, or any other front end.
Getting to your question, the URL is the URL of your SVN repository, plus any subdirectories. An example could be
file:///C:/svn/trunk/ProjectName
if your repository were stored locally, or
http://my.repo.site/trunk/ProjectName
if it is hosted on the Web.
Just hit F1. TortoiseSVN has good built-in help docs.
The url it's asking for is the svn repo to import your project into.
The Url you refer to is likely the address of the project at the Subversion repository (wherever that is, since you didn't mention any). If you right click on your local directory and choose properties you should be able to see a subversion tab where you can find the address your project came from.
If you don't have the repository data, then I think the best thing to do is make sure to remove all the .svn folders from your project folders - good discussion here - and start anew with the files you have. This will mean you don't get all the history you had previously, but, lacking the repository, I don't think there's a way to recover anyway.
Then using whatever tools you'd like create a new repository somewhere, checkout the empty root, copy in all of your folders and then commit.

Resources