Setting up a workspace using Team Explorer Everywhere on Linux - linux

Im having trouble creating a workspace and downloading the files from a Team Foundation Server using the Team Explorer Everywhere command line client (TEE-CLC-10.0.0). I've gotten as far as creating workspace:
$ ../tfs/TEE-CLC-10.0.0/tf -login:secretUsername,secretPassword -server:http://secretHost:8080 workspace -new KOLOBI
Workspace 'KOLOBI2' created.
Then I want to download files from the server to my workspace:
$ ../tfs/TEE-CLC-10.0.0/tf -login:secretUsername,secretPassword -server:http://secretHost:8080 get -recursive -all -force .
An argument error occurred: Items must reside in a workspace that has been previously used on this computer.
I guess I'm missing one step which is to add local directories to the workspace or something like that. But I can't figure out how to do it to be able to download the files.

You'll need to create working folder mappings between your local folder and the server items you wish to correspond to.
For example:
tf workfold -map -login:secretUsername,secretPassword -server:http://secretHost:8080 -workspace:KOLOBI '$/TeamProject/Project' '/home/me/project'
Then from the /home/me/project directory (or whatever you pick), you can just execute tf get .

Related

Azure Powershell - load variables from another script file

In Azure DevOps, I have an Azure Powershell task to create some resources using ps1 script in repo. This script working fine.
Now I need to split the script and variables into different files.
I created files SB-Config.ps1 for variables and ServiceBus.ps1 with main script. Moved all vars into SB-Config.ps1 .
Both files are in the same folder and in ServiceBus.ps1 I added:
. .\SB-Config.ps1
But Azure Devops fails with error:
What I'm doing wrong and how to get variables from SB-Config.ps1 script, when running ServiceBus.ps1 file?
I am able to reproduce your situation on my side.
Same issue as yours.
You can run this command to output the location of current work space:
Get-Location
I notice the powershell script file on your side is in the sub folder of Default working directory.
So do you set the work space in the powershell script file you are running first?
Set-Location $env:System_DefaultWorkingDirectory\subfolders
In your situation, I think the issue comes from the current work space is System_DefaultWorkingDirectory , the error output means the script can't get the file you want. This issue only occurs when you select 'file path' to run.

How to open D:\a\r1\a\ on Azure?

I'm running Cypress in one of my release stages and it gives me this output:
Finished processing: D:\a\r1\a\_ClientWeb-Build-CI\ShellArtifact\tests\integration\cypress\videos\onboarding.spec.js.mp4 (0 seconds)
I have 2 questions:
Is the path name relative to the app service? If I have a app service called randomname and run the Cypress Stage on that randomname app service should I be able to find tCypresshe output in randomname.scm.azurewebsites.net.
If I go into the scm debug console and I do cd D:\a\ I get:
cd : Cannot find path 'D:\a\' because it does not exist.
So how do I actually access my Cypress test results?
I've also tried archiving the files into a zip file:
In the output of the task step I see:
Creating archive: d:\home\testing\somefile.zip
But when I try to access the D:/home/testing folder on my appname.scm.azurewebsites.net I get:
cd : Cannot find path 'D:\home\testing' because it does not exist.
The path D:\a\r1\a is inside the hosted agent that run the release pipeline, is not in your application.
The same thing is for the zip file, when you specify d:/home/... is in the agent.
After the release is finish all the files are deleted, so you need to save the file in another place (maybe in azure?) during the pipeline, for example, with "Azure File Copy" task.

Teamcity deploy command line

I've configured TeamCity for build and deploy IIS app.
Everything works fine. Here is my command line param:
-verb:sync -source:package="webapi-%dep.xxx.build.counter%.zip"
-dest:contentpath="C:\inetpub\wwwroot\test2.com\bin",computerName="www",userName="uuu",password="ccc",includeAcls="False"
-AllowUntrusted -verbose
So, artifacts zip file should extract files to C:\inetpub\wwwroot\test2.com\bin folder. In bin folder i have a lot of xml and config files (zip file dont include this files). In every deploy it delete bin folder and extract zip files.
How can I skip deleting? I just need publish with replace what i have in archive without deleting another files?
Thanks for help
add one more parameter:
-enableRule:DoNotDeleteRule
according to doc:
In a sync operation, blocks deletions of files on the destination computer that do not exist on the source computer. This rule applies to the contentPath, dirPath, and filePath providers. This rule is disabled by default.

Publish .Net Core to IIS - Process cannot access file

I am deploying my ASP .Net Core 2.0 app to my remote server using FTP. Remote Server is using IIS 8. When I publish my app, I get the following error.
Unable to add 'Project.dll' to the Web site. The process cannot access the file because it is being used by another process (550).
I been able to bypass this by manually creating an app_offline.htm first on the publish directory, and then publishing my app via Visual Studio 2017.
I was wondering, is there an easier way of doing this? or is there an easy way I can script this, so that app_offline gets created automatically before publish? and then deleted after publish?
Anyone that's curious, I gave up depending on VS to publish my .NET Core project. I'm now using WinSCP and _PublishToWeb.bat script I created to accomplish the task.
I first created a file called _app.offline.htm on root directory my publish folder. Then when I need to publish, I run the script below.
This script does the following:
1. Builds the .NET Core project to a specific folder, let's call it "_dist" folder.
2. Connects to my ftp server/publish folder and renames "_app_offline.html" to "app_offline.html", so that the server goes offline.
3. Synchronizes _dist folder with publish folder.
4. When done, changes "app_offline.htm" to "_app_offline.html", so the website is restarted.
_PublishToWeb.bat
echo off
echo Publishing to ProjectName (Optional)
set ProjectRemoteFolder=RemoteFolderName
set ConnectionString=ftp://username:password#serverIp:serverPort
set WinSCP="path to WinSCP.com"
set ProjectDistPath="a folder where dotnet publish will build the project to"
set WebAppProject="path of the project. dotnet publish will run here"
rem Build project and put it in to distribution folder
cd %WebAppProject%
dotnet publish -c Release -o %ProjectDistPath%
rem Connect to FTP and synchronize folder
%WinSCP% /command "open %ConnectionString%/%ProjectRemoteFolder%/" "mv _app_offline.htm app_offline.htm" "synchronize remote %ProjectDistPath%" "mv app_offline.htm _app_offline.htm" "exit"
rem pause
I'm sure there are better solutions out there, but this has been working well for me so far.

TFS Workspace and Workfold conflicting on Linux with hosted TFS (VisualStudio.com)

I'm trying to figure out how to connect to TFS and get code stored on the hosted TFS (ie - visualstudio.com) down to my linux web server.
I have installed the TFS command-line client (tf.exe)
i run the following command:
$ tf workspace -new "My - Workspace" -collection:https://me.visualstudio.com/DefaultCollection -login:user,pass
then, i list the workspaces:
$ tf workspaces
Collection: https://gotmike.visualstudio.com/DefaultCollection/
Workspace Owner Computer Comment
-------------------- ----------- ------------------ -------------
My - Workspace My Name ip-xxx-xxx-xxx-xxx
all seems good...
then, i try to run workfold...
$ tf workfold -map -login:user,pass -server:http://me.visualstudio.com -workspace:"My - Workspace" '$/My - Workspace/My - Workspace' '/home/me/test'
An argument error occurred: The workspace 'My - Workspace' could not be found.
how can it not be found if it's showing up in the list? what am i doing wrong?
The /server flag is deprecated and should not be used against recent servers (those that have "project collections", like Visual Studio Online.) Instead use the /collection flag, like you did in the first example. The workspace should then be able to be found in the specified project collection.
For example:
tf workfold -map -login:user,pass -collection:https://me.visualstudio.com/DefaultCollection -workspace:"My - Workspace" '$/My - Workspace/My - Workspace' '/home/me/test'

Resources