Microsoft MVP성태의 닷넷 이야기
Linux: 14. 리눅스 환경에서 TFS 서버 연동 [링크 복사], [링크+제목 복사]
조회: 12103
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

리눅스 환경에서 TFS 서버 연동

리눅스 환경의 tfvc 명령행 버전을,

TFVC Command Line Client
; https://github.com/Microsoft/azure-repos-vscode/blob/master/TFVC_README.md#tfvc-command-line-client

다음과 같이 다운로드해 압축을 해제합니다. (여기서는 temp 폴더 하위에 설치)

$ mkdir temp
$ cd temp
$ curl -L https://github.com/Microsoft/team-explorer-everywhere/releases/download/v14.114.0/TEE-CLC-14.114.0.zip --output tee-clc.zip

$ unzip tee-clc.zip

$ cd TEE-CLC-14.114.0

그럼 "tf" 파일명의 shell 스크립트 파일이 있을 텐데 그걸 이용해 TFS와 연동하게 됩니다.




만약 java가 없다면 설치해야 하는데요, 우분투 16.04의 경우 "default-jdk"를 설치합니다.

$ sudo apt install default-jdk

그런데 18.04의 경우,

$ java

Command 'java' not found, but can be installed with:

sudo apt install default-jre
sudo apt install openjdk-11-jre-headless
sudo apt install openjdk-8-jre-headless

여러 가지 옵션이 있는데 이 중에서 openjdk-11의 경우 ./tf 스크립트가 실행은 되지만 아무런 출력 결과가 보이지 않게 되는데 아무래도 비정상 동작하는 것 같습니다. 따라서 8 버전의 자바를 설치하는 것이 좋습니다.

$ sudo apt install openjdk-8-jre-headless




여기까지 준비되었으면 "./tf"라고 실행 시 다음과 같은 식의 출력이 보입니다.

$ ./tf
Team Explorer Everywhere Command Line Client (version 14.114.0.201703081734)

 Available commands and their options:

  add         [-lock:none|checkin|checkout] [-type:<value>] [-recursive] [-silent] [-noignore]
              <localItemSpec>...
  branch      [-version:<value>] [-noget] [-lock:none|checkin|checkout] [-recursive] [-checkin]
              [-comment:<value>|@valuefile] [-author:<value>]
              [-notes:"note"="value"[;"note2"="value2"[;...]]|@notefile] <oldItemSpec> <newLocalItem>
  branches    [-version:<value>] <itemSpec>...
  changeset   [-latest] [-comment:<value>|@valuefile]
              [-notes:"note"="value"[;"note2"="value2"[;...]]|@notefile] [changenumber]
  checkin     [-all] [-author:<value>] [-comment:<value>|@valuefile]
              [-notes:"note"="value"[;"note2"="value2"[;...]]|@notefile] [-override:<value>|@valuefile]
              [-recursive] [-validate] [-bypass] [-force] [-noautoresolve]
              [-associate:<workItemID>[,<workItemID>...]] [-resolve:<workItemID>[,<workItemID>...]] [-saved]
              [<itemSpec>...]
  checkout    [-recursive] [-lock:none|checkin|checkout] [-type:<value>] <itemSpec>...
  delete      [-lock:none|checkin|checkout] [-recursive] <itemSpec>...
  delete      -detect [-lock:none|checkin|checkout] [-recursive]
  destroy     [-keephistory] [-startcleanup] [-preview] [-silent] [-stopat:<value>] [-noprompt]
              itemspec1[;versionspec][;XdeletionID] [itemspec2...itemspecN]
  difference  [-recursive] <itemSpec> <itemSpec2>
  difference  [-shelveset:<value>] [-recursive] <shelvesetItemSpec>
  difference  [-version:<value>] [-recursive] <itemSpec>
  dir         [-version:<value>] [-recursive] [-folders] [-deleted] <itemSpec>...
  eula        [-accept]
  get         [-version:<value>] [-recursive] [-preview] [-force] [-all] [-overwrite] [-noautoresolve]
              [<itemSpec>...]
  getcs       -changeset:changeset [-latest]
  help        [-listexitcodes] [<command>]
  history     [-version:<value>] [-stopafter:<value>] [-recursive] [-user:<value>]
              [-format:brief|detailed|xml] [-slotmode] [-itemmode] <itemSpec>
  info        [-recursive] [-version:<value>] <itemSpec>...
  label       [-owner:<value>] [-version:<value>] [-comment:<value>|@valuefile] [-child:fail|replace|merge]
              [-recursive] <labelName>[@<scope>] <itemSpec>...
  label       -delete [-owner:<value>] [-version:<value>] <labelName>[@<scope>]
  labels      [-owner:<value>] [-format:brief|detailed|xml] [<labelNameFilter>]
  lock        [-recursive] [-lock:none|checkin|checkout] <itemSpec>...
  merge       [-recursive] [-force] [-candidate] [-discard] [-version:<value>] [-lock:none|checkin|checkout]
              [-preview] [-baseless] [-nosummary] [-noimplicitbaseless] [-format:brief|detailed|xml]
              [-noautoresolve] <source> <destination>
  merges      [-recursive] [-format:brief|detailed|xml] [<sourceItem>] <destinationItem>
  online      [-adds] [-deletes] [-diff] [-exclude:<value>[,<value>]] [-recursive] [-preview] [<itemSpec>...]
  print       [-version:<value>] <itemSpec>
  property    [-output:<value>] [-recursive] [-version:<value>] <itemSpec> [<propertyname>]
  property    -deleteall [-recursive] <itemSpec>
  property    -deletevalues:<value>[,<value>] [-recursive] <itemSpec>
  property    -setvalues:@valuefile|name1=value1[;name2=value2;name3=@valuefile;...] [-recursive] <itemSpec>
  reconcile   [-teamProject:<value>]
  reconcile   -buildName:<value> [-teamProject:<value>] [-recursive] [<itemSpec>...]
  reconcile   -changeset:changeset [-recursive] [<itemSpec>...]
  reconcile   -forgetBuild:<buildName> [-teamProject:<value>]
  rename      [-lock:none|checkin|checkout] <oldItem> <newItem>
  resolve     [-auto:AutoMerge|TakeTheirs|KeepYours|OverwriteLocal|DeleteConflict|KeepYoursRenameTheirs|
              External] [-preview] [-converttotype:<value>] [-recursive] [-newname:<value>] <itemSpec>
  resolve     [-auto:AutoMerge|TakeTheirs|KeepYours|OverwriteLocal|DeleteConflict|KeepYoursRenameTheirs|
              External] [-preview] [-overridetype:<value>] [-recursive] [-newname:<value>] <itemSpec>
  resolvePath [-collection:<url>] [-workspace:<value>] <serverPath>
  resolvePath <serverPath>
  rollback    -changeset:changesetfrom~changesetto [-recursive] [-lock:none|checkin|checkout]
              [-version:<value>] [-keepmergehistory] [-noautoresolve] [<itemSpec>...]
  rollback    -toversion:versionspec [-recursive] [-lock:none|checkin|checkout] [-version:<value>]
              [-keepmergehistory] [-noautoresolve] <itemSpec>...
  shelve      [-move] [-replace] [-comment:<value>|@valuefile] [-recursive] [-validate] [-saved]
              <shelvesetName[;owner]> <fileSpec>...
  shelve      [-replace] [-comment:<value>|@valuefile] [-validate] [-saved] <shelvesetName[;owner]>
  shelve      -delete [-collection:<url>] [-validate] [-saved] <shelvesetName[;owner]>
  shelvesets  [-owner:<value>] [-format:brief|detailed|xml] [<shelvesetName>]
  status      [-workspace:<value>] [-shelveset:<value>] [-format:brief|detailed|xml] [-recursive]
              [-user:<value>] [-nodetect] [<itemSpec>...]
  undelete    [-noget] [-lock:none|checkin|checkout] [-newname:<value>] <itemSpec>[;deletionID]...
  undelete    [-noget] [-lock:none|checkin|checkout] [-recursive] <itemSpec>[;deletionID]...
  undo        [-recursive] <itemSpec>...
  unlabel     [-recursive] <labelName>[@<scope>] <itemSpec>...
  unshelve    [-move] [-recursive] [-nomerge] [-noautoresolve] [-format:brief|detailed|xml]
              <shelvesetName[;owner]> [<itemSpec>...]
  uu          [-recursive] [-noprompt] <itemSpec>...
  workfold    [-collection:<url>] [-workspace:<value>] <serverFolder>
  workfold    [-map] [-collection:<url>] [-workspace:<value>] <serverFolder> <localFolder>
  workfold    [-workspace:<value>]
  workfold    <localFolder>
  workfold    -cloak [-collection:<url>] [-workspace:<value>] <serverFolder>|<localFolder>
  workfold    -decloak [-collection:<url>] [-workspace:<value>] <serverFolder>|<localFolder>
  workfold    -unmap [-collection:<url>] [-workspace:<value>] <serverFolder>|<localFolder>
  workspace   [-collection:<url>] [-comment:<value>|@valuefile] [-newname:<value>]
              [-filetime:current|checkin] [-permission:Private|PublicLimited|Public]
              [<workspacename;[workspaceowner]>]
  workspace   -delete [-collection:<url>] [<workspacename;[workspaceowner]>]
  workspace   -new [-noprompt] [-template:<value>] [-computer:<value>] [-comment:<value>|@valuefile]
              [-collection:<url>] [-location:server|local] [-filetime:current|checkin]
              [-permission:Private|PublicLimited|Public] [<workspacename;[workspaceowner]>]
  workspaces  [-owner:<value>] [-computer:<value>] [-collection:<url>] [-format:brief|detailed|xml]
              [-updateUserName:<user@domain>|<domain\user>] [-updateComputerName:<value>] workspaceName
  workspaces  -remove:<workspace1>[,<workspace2>,...] -collection:<url>

 Options accepted by most commands:

  [-login:domain\username,password] | [-login:username@domain,password]
  -collection:<url>
  -continueOnError
  -exitcode
  -help
  -noprompt
  -nosummary
  -outputSeparator:<value>
  -proxy:<url>
  -server:<url>
  -workspace:<value>

Options may be started with any of: -

For general help, view the 'help/index.htm' file installed with the program.
For help on a specific command, supply the command name as an argument
to the help command.  For example: 'tf help checkin'

우선, eula 동의를 한 다음,

$ ./tf eula

현재의 우분투 컴퓨터를 위한 workspace를 하나 추가합니다.

$ ~/temp/TEE-CLC-14.114.0/tf workspace -new -computer:ubuntu18 -collection:http://192.168.100.70:8080/tfs/defaultcollection -location:local
Default credentials are unavailable because no Kerberos ticket or other authentication token is available.
Username: testad\testusr
Password: 
Workspace 'ubuntu18' created.

생성된 workspace는 Visual Studio의 "소스 컨트롤 탐색기"에서도 확인할 수 있습니다.

tfs_linux_1.png

자, 그럼 이제 workspace에 현재 컴퓨터의 로컬 경로와 서버 측의 Team 프로젝트에 대한 경로를 매핑시켜 보겠습니다.

$ mkdir testprj

$ cd testprj

~/testprj$ ~/temp/TEE-CLC-14.114.0/tf workfold -map -collection:http://192.168.100.70:8080/tfs/defaultcollection -workspace:ubuntu18 $/testsolution/testprj ~/testprj -login:"testad\testusr"

서버 측 소스 컨트롤의 경로($/testsolution/testprj)를 우분투 로컬 PC의 경로(~/testprj)에 매핑시켰으니 이제 해당 프로젝트의 소스 코드를 가져올 수 있습니다.

~/testprj$ ~/temp/TEE-CLC-14.114.0/tf get . -recursive -login:"testad\testusr"

이 정도면, 대충 어떤 식으로 연동해야 할지 감이 올 것입니다. ^^




위의 실행 예제에도 나오지만,

Default credentials are unavailable because no Kerberos ticket or other authentication token is available.

매번 인증 정보를 입력해야 한다는 매우 불편한 점이 있습니다. 물론 명령행에 계정뿐만 아니라 암호까지 입력할 수 있지만,

$ ~/temp/TEE-CLC-14.114.0/tf get . -recursive -login:"testad\testusr,...password..."

누가 저런 식으로 ^^; 평문 입력을 하겠습니까? 이 문제를 해결하기 위해, 인증 정보를 저장하라는 환경 변수를 설정한 다음,

$ export TF_AUTO_SAVE_CREDENTIALS="1"

Kerberos 인증 모듈을 설치하면 됩니다.

$ sudo apt install krb5-user

이후의 명령어들은 다음과 같이 인증 정보 입력 없이 곧바로 실행됩니다.

$ ~/temp/TEE-CLC-14.114.0/tf get . -recursive 
All files up to date.




tfvc가 비정상적으로 동작하고 있다면 로그 파일을 확인해야 합니다. tf 명령어마다 다음의 경로에 로그가 남겨지고,

~/.microsoft/Team\ Foundation/4.0/Logs/

이를 확인하면 됩니다.

$ ls ~/.microsoft/Team\ Foundation/4.0/Logs/
teamexplorer-clc-2019.06.17-13.45.48.log  teamexplorer-soap-clc-2019.06.17-13.26.53.log

$ cat ~/.microsoft/Team\ Foundation/4.0/Logs/teamexplorer-clc-2019.06.17-13.26.53.log 

일례로, 다음은 krb5-user 모듈이 없는 상황에서 TF_AUTO_SAVE_CREDENTIALS="1" 환경 변수만 설정했을 때 발생하는 오류를 보여줍니다.

$ cat ~/.microsoft/Team\ Foundation/4.0/Logs/teamexplorer-clc-2019.06.17-13.45.48.log 
2019-06-17 13:45:49,872 INFO  [main] (com.microsoft.tfs.core.telemetry.TfsTelemetryHelper) Command Line Client v.14.114.0.201703081734
2019-06-17 13:45:49,873 INFO  [main] (com.microsoft.tfs.core.telemetry.TfsTelemetryHelper) AppInsights telemetry initialized
2019-06-17 13:45:49,873 INFO  [main] (com.microsoft.tfs.core.telemetry.TfsTelemetryHelper)     Developer Mode: false
2019-06-17 13:45:49,873 INFO  [main] (com.microsoft.tfs.core.telemetry.TfsTelemetryHelper)     Production Environment: true
2019-06-17 13:45:50,288 INFO  [main] (com.microsoft.alm.storage.posix.internal.GnomeKeyringBackedSecureStore) gnome-keyring library not loaded
java.lang.UnsatisfiedLinkError: Unable to load library 'gnome-keyring': Native library (linux-x86-64/libgnome-keyring.so) not found in resource path ([file:...[생략]...])
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:277)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:403)
        at com.sun.jna.Library$Handler.<init>(Library.java:147)
        at com.sun.jna.Native.loadLibrary(Native.java:502)
        at com.sun.jna.Native.loadLibrary(Native.java:481)
        at com.microsoft.alm.storage.posix.internal.GnomeKeyringLibrary.<clinit>(GnomeKeyringLibrary.java:23)
        at com.microsoft.alm.storage.posix.internal.GnomeKeyringBackedSecureStore.isGnomeKeyringLibraryAvailable(GnomeKeyringBackedSecureStore.java:210)
        at com.microsoft.alm.storage.posix.internal.GnomeKeyringBackedSecureStore.getGnomeKeyringLibrary(GnomeKeyringBackedSecureStore.java:232)
        at com.microsoft.alm.storage.posix.internal.GnomeKeyringBackedSecureStore.<clinit>(GnomeKeyringBackedSecureStore.java:17)
        at com.microsoft.tfs.core.credentials.internal.GnomeKeyringCredentialsManager.<clinit>(GnomeKeyringCredentialsManager.java:23)
        at com.microsoft.tfs.core.credentials.CredentialsManagerFactory.getCredentialsManager(CredentialsManagerFactory.java:89)
        at com.microsoft.tfs.client.clc.commands.Command.createConnection(Command.java:1537)
        at com.microsoft.tfs.client.clc.commands.Command.createConnection(Command.java:1196)
        at com.microsoft.tfs.client.clc.vc.commands.CommandGet.run(CommandGet.java:171)
        at com.microsoft.tfs.client.clc.Application.run(Application.java:306)
        at com.microsoft.tfs.client.clc.Application.run(Application.java:154)
        at com.microsoft.tfs.client.clc.vc.Main.main(Main.java:55)
2019-06-17 13:45:50,290 INFO  [main] (com.microsoft.alm.storage.posix.internal.GnomeKeyringBackedSecureStore) gnome-keyring library not loaded
java.lang.NoClassDefFoundError: Could not initialize class com.microsoft.alm.storage.posix.internal.GnomeKeyringLibrary
        at com.microsoft.alm.storage.posix.internal.GnomeKeyringBackedSecureStore.isGnomeKeyringLibraryAvailable(GnomeKeyringBackedSecureStore.java:210)
        at com.microsoft.alm.storage.posix.internal.GnomeKeyringBackedSecureStore.getGnomeKeyringPasswordSchema(GnomeKeyringBackedSecureStore.java:236)
        at com.microsoft.alm.storage.posix.internal.GnomeKeyringBackedSecureStore.<clinit>(GnomeKeyringBackedSecureStore.java:18)
        at com.microsoft.tfs.core.credentials.internal.GnomeKeyringCredentialsManager.<clinit>(GnomeKeyringCredentialsManager.java:23)
        at com.microsoft.tfs.core.credentials.CredentialsManagerFactory.getCredentialsManager(CredentialsManagerFactory.java:89)
        at com.microsoft.tfs.client.clc.commands.Command.createConnection(Command.java:1537)
        at com.microsoft.tfs.client.clc.commands.Command.createConnection(Command.java:1196)
        at com.microsoft.tfs.client.clc.vc.commands.CommandGet.run(CommandGet.java:171)
        at com.microsoft.tfs.client.clc.Application.run(Application.java:306)
        at com.microsoft.tfs.client.clc.Application.run(Application.java:154)
        at com.microsoft.tfs.client.clc.vc.Main.main(Main.java:55)
2019-06-17 13:45:50,290 INFO  [main] (com.microsoft.alm.storage.posix.internal.GnomeKeyringBackedSecureStore) gnome-keyring library not loaded, return null for SCHEMA
2019-06-17 13:45:54,528 INFO  [main] (com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory) HttpClient configured for http://192.168.100.70:8080/tfs/defaultcollection/, authenticating as testad\testusr
2019-06-17 13:45:55,964 ERROR [main] (com.microsoft.tfs.jni.natives.NativeAuthMethods) Could not load GSSAPI library, Kerberos authentication disabled
2019-06-17 13:45:56,745 INFO  [main] (com.microsoft.tfs.client.clc.vc.Main) Shutting down
2019-06-17 13:45:56,752 INFO  [main] (com.microsoft.tfs.client.clc.vc.Main) Has shut down




참고로, TEE-CLC-14.114.0.zip 파일의 다운로드 경로가 redirection URL이라서 아무런 옵션 없이 curl을 이용해 다운로드하면 다음과 같은 오류가 발생합니다.



따라서 "-L" 옵션을 줘야 합니다.

$ curl -L https://github.com/Microsoft/team-explorer-everywhere/releases/download/v14.114.0/TEE-CLC-14.114.0.zip





[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 9/25/2019]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




1  2  [3]  4  5  6  7  8  9  10  11  12  13  14  15  ...
NoWriterDateCnt.TitleFile(s)
13551정성태2/12/20242016닷넷: 2213. ASP.NET/Core 웹 응용 프로그램 - 2차 스레드의 예외로 인한 비정상 종료
13550정성태2/11/20242107Windows: 256. C# - Server socket이 닫히면 Accept 시켰던 자식 소켓이 닫힐까요?
13549정성태2/3/20242477개발 환경 구성: 706. C# - 컨테이너에서 실행하기 위한 (소켓) 콘솔 프로젝트 구성
13548정성태2/1/20242308개발 환경 구성: 705. "Docker Desktop for Windows" - ASP.NET Core 응용 프로그램의 소켓 주소 바인딩(IPv4/IPv6 loopback, Any)
13547정성태1/31/20242056개발 환경 구성: 704. Visual Studio - .NET 8 프로젝트부터 dockerfile에 추가된 "USER app" 설정
13546정성태1/30/20241896Windows: 255. (디버거의 영향 등으로) 대상 프로세스가 멈추면 Socket KeepAlive로 연결이 끊길까요?
13545정성태1/30/20241828닷넷: 2212. ASP.NET Core - 우선순위에 따른 HTTP/HTTPS 호스트:포트 바인딩 방법
13544정성태1/30/20241846오류 유형: 894. Microsoft.Data.SqlClient - Could not load file or assembly 'System.Security.Permissions, ...'
13543정성태1/30/20241824Windows: 254. Windows - 기본 사용 중인 5357 포트 비활성화는 방법
13542정성태1/30/20241876오류 유형: 893. Visual Studio - Web Application을 실행하지 못하는 IISExpress - 두 번째 이야기
13541정성태1/29/20241922VS.NET IDE: 188. launchSettings.json의 useSSL 옵션
13540정성태1/29/20242051Linux: 69. 리눅스 - "Docker Desktop for Windows" Container 환경에서 IPv6 Loopback Address 바인딩 오류
13539정성태1/26/20242146개발 환경 구성: 703. Visual Studio - launchSettings.json을 이용한 HTTP/HTTPS 포트 바인딩
13538정성태1/25/20242213닷넷: 2211. C# - NonGC(FOH) 영역에 .NET 개체를 생성파일 다운로드1
13537정성태1/24/20242268닷넷: 2210. C# - Native 메모리에 .NET 개체를 생성파일 다운로드1
13536정성태1/23/20242372닷넷: 2209. .NET 8 - NonGC Heap / FOH (Frozen Object Heap) [1]
13535정성태1/22/20242206닷넷: 2208. C# - GCHandle 구조체의 메모리 분석
13534정성태1/21/20242038닷넷: 2207. C# - SQL Server DB를 bacpac으로 Export/Import파일 다운로드1
13533정성태1/18/20242233닷넷: 2206. C# - TCP KeepAlive의 서버 측 구현파일 다운로드1
13532정성태1/17/20242141닷넷: 2205. C# - SuperSimpleTcp 사용 시 주의할 점파일 다운로드1
13531정성태1/16/20242025닷넷: 2204. C# - TCP KeepAlive에 새로 추가된 Retry 옵션파일 다운로드1
13530정성태1/15/20242010닷넷: 2203. C# - Python과의 AES 암호화 연동파일 다운로드1
13529정성태1/15/20241894닷넷: 2202. C# - PublishAot의 glibc에 대한 정적 링킹하는 방법
13528정성태1/14/20242032Linux: 68. busybox 컨테이너에서 실행 가능한 C++, Go 프로그램 빌드
13527정성태1/14/20241959오류 유형: 892. Visual Studio - Failed to launch debug adapter. Additional information may be available in the output window.
13526정성태1/14/20242048닷넷: 2201. C# - Facebook 연동 / 사용자 탈퇴 처리 방법
1  2  [3]  4  5  6  7  8  9  10  11  12  13  14  15  ...