Microsoft MVP성태의 닷넷 이야기
Linux: 14. 리눅스 환경에서 TFS 서버 연동 [링크 복사], [링크+제목 복사]
조회: 12082
글쓴 사람
정성태 (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)
13294정성태3/22/20234122.NET Framework: 2105. LargeAddressAware 옵션이 적용된 닷넷 32비트 프로세스의 가용 메모리 - 두 번째
13293정성태3/22/20234191오류 유형: 853. dumpbin - warning LNK4048: Invalid format file; ignored
13292정성태3/21/20234305Windows: 232. C/C++ - 일반 창에도 사용 가능한 IsDialogMessage파일 다운로드1
13291정성태3/20/20234712.NET Framework: 2104. C# Windows Forms - WndProc 재정의와 IMessageFilter 사용 시의 차이점
13290정성태3/19/20234219.NET Framework: 2103. C# - 윈도우에서 기본 제공하는 FindText 대화창 사용법파일 다운로드1
13289정성태3/18/20233416Windows: 231. Win32 - 대화창 템플릿의 2진 리소스를 읽어들여 자식 윈도우를 생성하는 방법파일 다운로드1
13288정성태3/17/20233515Windows: 230. Win32 - 대화창의 DLU 단위를 pixel로 변경하는 방법파일 다운로드1
13287정성태3/16/20233683Windows: 229. Win32 - 대화창 템플릿의 2진 리소스를 읽어들여 윈도우를 직접 띄우는 방법파일 다운로드1
13286정성태3/15/20234146Windows: 228. Win32 - 리소스에 포함된 대화창 Template의 2진 코드 해석 방법
13285정성태3/14/20233736Windows: 227. Win32 C/C++ - Dialog Procedure를 재정의하는 방법파일 다운로드1
13284정성태3/13/20233937Windows: 226. Win32 C/C++ - Dialog에서 값을 반환하는 방법파일 다운로드1
13283정성태3/12/20233478오류 유형: 852. 파이썬 - TypeError: coercing to Unicode: need string or buffer, NoneType found
13282정성태3/12/20233807Linux: 58. WSL - nohup 옵션이 필요한 경우
13281정성태3/12/20233716Windows: 225. 윈도우 바탕화면의 아이콘들이 넓게 퍼지는 경우 [2]
13280정성태3/9/20234453개발 환경 구성: 670. WSL 2에서 호스팅 중인 TCP 서버를 외부에서 접근하는 방법
13279정성태3/9/20233997오류 유형: 851. 파이썬 ModuleNotFoundError: No module named '_cffi_backend'
13278정성태3/8/20233945개발 환경 구성: 669. WSL 2의 (init이 아닌) systemd 지원 [1]
13277정성태3/6/20234576개발 환경 구성: 668. 코드 사인용 인증서 신청 및 적용 방법(예: Digicert)
13276정성태3/5/20234306.NET Framework: 2102. C# 11 - ref struct/ref field를 위해 새롭게 도입된 scoped 예약어
13275정성태3/3/20234660.NET Framework: 2101. C# 11의 ref 필드 설명
13274정성태3/2/20234252.NET Framework: 2100. C# - ref 필드로 ref struct 타입을 허용하지 않는 이유
13273정성태2/28/20233953.NET Framework: 2099. C# - 관리 포인터로서의 ref 예약어 의미
13272정성태2/27/20234201오류 유형: 850. SSMS - mdf 파일을 Attach 시킬 때 Operating system error 5: "5(Access is denied.)" 에러
13271정성태2/25/20234142오류 유형: 849. Sql Server Configuration Manager가 시작 메뉴에 없는 경우
13270정성태2/24/20233754.NET Framework: 2098. dotnet build에 /p 옵션을 적용 시 유의점
13269정성태2/23/20234290스크립트: 46. 파이썬 - uvicorn의 콘솔 출력을 UDP로 전송
1  2  3  4  5  6  7  8  9  10  11  12  [13]  14  15  ...