Microsoft MVP성태의 닷넷 이야기
Linux: 14. 리눅스 환경에서 TFS 서버 연동 [링크 복사], [링크+제목 복사]
조회: 12105
글쓴 사람
정성태 (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

비밀번호

댓글 작성자
 




... 16  17  18  19  20  21  22  [23]  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
13046정성태5/5/20226772.NET Framework: 2002. C# XingAPI - ACF 파일을 이용한 퀀트 종목 찾기(t1857)
13045정성태5/5/20226834.NET Framework: 2001. C# XingAPI - 주식 종목에 따른 PBR, PER, ROE 구하는 방법(t3341 예제)
13044정성태5/4/20226299오류 유형: 808. error : clang++ exited with code 127
13043정성태5/3/20225934오류 유형: 807. C# - 닷넷 응용 프로그램에서 Informix DB 사용 시 오류 메시지 정리
13042정성태5/3/20226324.NET Framework: 2000. C# - 닷넷 응용 프로그램에서 Informix DB 사용 방법파일 다운로드1
13041정성태4/28/20226586개발 환경 구성: 642. Informix 데이터베이스 docker 환경 구성
13040정성태4/27/20227124VC++: 156. 비주얼 스튜디오 - Linux C/C++ 프로젝트에서 openssl 링크하는 방법
13039정성태4/27/20227887.NET Framework: 1999. C# - Playwright를 이용한 간단한 브라우저 제어 실습
13038정성태4/26/20225806오류 유형: 806. twine 실행 시 ConfigParser.ParsingError: File contains parsing errors: /root/.pypirc
13037정성태4/25/20226114.NET Framework: 1998. Azure Functions를 사용한 간단한 실습
13036정성태4/24/20226841.NET Framework: 1997. C# - nano 시간을 가져오는 방법 [2]
13035정성태4/22/20227400Windows: 204. Windows 10부터 바뀐 QueryPerformanceFrequency, QueryPerformanceCounter
13034정성태4/21/20226819.NET Framework: 1996. C# XingAPI - 주식 종목에 따른 PBR, PER, ROE, ROA 구하는 방법(t3320, t8430 예제)파일 다운로드1
13033정성태4/18/20227410.NET Framework: 1195. C# - Thread.Yield와 Thread.Sleep(0)의 차이점(?)
13032정성태4/17/20227120오류 유형: 805. Github의 50MB 파일 크기 제한 - warning: GH001: Large files detected. You may want to try Git Large File Storage
13031정성태4/15/20226664.NET Framework: 1194. C# - IdealProcessor와 ProcessorAffinity의 차이점
13030정성태4/15/20226343오류 유형: 804. 정규 표현식 오류 - Quantifier {x,y} following nothing.
13029정성태4/14/20226754Windows: 203. iisreset 후에도 이전에 설정한 전역 환경 변수가 w3wp.exe에 적용되는 문제
13028정성태4/13/20226666.NET Framework: 1193. (appsettings.json처럼) web.config의 Debug/Release에 따른 설정 적용
13027정성태4/12/20226945.NET Framework: 1192. C# - 환경 변수의 변화를 알리는 WM_SETTINGCHANGE Win32 메시지 사용법파일 다운로드1
13026정성태4/11/20228446.NET Framework: 1191. C 언어로 작성된 FFmpeg Examples의 C# 포팅 전체 소스 코드 [3]
13025정성태4/11/20227811.NET Framework: 1190. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 vaapi_encode.c, vaapi_transcode.c 예제 포팅
13024정성태4/7/20226322.NET Framework: 1189. C# - 런타임 환경에 따라 달라진 AppDomain.GetCurrentThreadId 메서드
13023정성태4/6/20226636.NET Framework: 1188. C# - ffmpeg(FFmpeg.AutoGen)를 이용한 transcoding.c 예제 포팅 [3]
13022정성태3/31/20226518Windows: 202. 윈도우 11 업그레이드 - "PC Health Check"를 통과했지만 여전히 업그레이드가 안 되는 경우 해결책
13021정성태3/31/20226675Windows: 201. Windows - INF 파일을 이용한 장치 제거 방법
... 16  17  18  19  20  21  22  [23]  24  25  26  27  28  29  30  ...