Microsoft MVP성태의 닷넷 이야기
Linux: 14. 리눅스 환경에서 TFS 서버 연동 [링크 복사], [링크+제목 복사]
조회: 12102
글쓴 사람
정성태 (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)
13272정성태2/27/20234215오류 유형: 850. SSMS - mdf 파일을 Attach 시킬 때 Operating system error 5: "5(Access is denied.)" 에러
13271정성태2/25/20234148오류 유형: 849. Sql Server Configuration Manager가 시작 메뉴에 없는 경우
13270정성태2/24/20233757.NET Framework: 2098. dotnet build에 /p 옵션을 적용 시 유의점
13269정성태2/23/20234293스크립트: 46. 파이썬 - uvicorn의 콘솔 출력을 UDP로 전송
13268정성태2/22/20234847개발 환경 구성: 667. WSL 2 내부에서 열고 있는 UDP 서버를 호스트 측에서 접속하는 방법
13267정성태2/21/20234772.NET Framework: 2097. C# - 비동기 소켓 사용 시 메모리 해제가 finalizer 단계에서 발생하는 사례파일 다운로드1
13266정성태2/20/20234375오류 유형: 848. .NET Core/5+ - Process terminated. Couldn't find a valid ICU package installed on the system
13265정성태2/18/20234287.NET Framework: 2096. .NET Core/5+ - PublishSingleFile 유형에 대한 runtimeconfig.json 설정
13264정성태2/17/20235785스크립트: 45. 파이썬 - uvicorn 사용자 정의 Logger 작성
13263정성태2/16/20233918개발 환경 구성: 666. 최신 버전의 ilasm.exe/ildasm.exe 사용하는 방법
13262정성태2/15/20235006디버깅 기술: 191. dnSpy를 이용한 (소스 코드가 없는) 닷넷 응용 프로그램 디버깅 방법 [1]
13261정성태2/15/20234299Windows: 224. Visual Studio - 영문 폰트가 Fullwidth Latin Character로 바뀌는 문제
13260정성태2/14/20234083오류 유형: 847. ilasm.exe 컴파일 오류 - error : syntax error at token '-' in ... -inf
13259정성태2/14/20234209.NET Framework: 2095. C# - .NET5부터 도입된 CollectionsMarshal
13258정성태2/13/20234107오류 유형: 846. .NET Framework 4.8 Developer Pack 설치 실패 - 0x81f40001
13257정성태2/13/20234203.NET Framework: 2094. C# - Job에 Process 포함하는 방법 [1]파일 다운로드1
13256정성태2/10/20235056개발 환경 구성: 665. WSL 2의 네트워크 통신 방법 - 두 번째 이야기
13255정성태2/10/20234350오류 유형: 845. gihub - windows2022 이미지에서 .NET Framework 4.5.2 미만의 프로젝트에 대한 빌드 오류
13254정성태2/10/20234262Windows: 223. (WMI 쿼리를 위한) PowerShell 문자열 escape 처리
13253정성태2/9/20235038Windows: 222. C# - 다른 윈도우 프로그램이 실행되었음을 인식하는 방법파일 다운로드1
13252정성태2/9/20233852오류 유형: 844. ssh로 명령어 수행 시 멈춤 현상
13251정성태2/8/20234317스크립트: 44. 파이썬의 3가지 스레드 ID
13250정성태2/8/20236114오류 유형: 843. System.InvalidOperationException - Unable to configure HTTPS endpoint
13249정성태2/7/20234925오류 유형: 842. 리눅스 - You must wait longer to change your password
13248정성태2/7/20234046오류 유형: 841. 리눅스 - [사용자 계정] is not in the sudoers file. This incident will be reported.
13247정성태2/7/20234962VS.NET IDE: 180. Visual Studio - 닷넷 소스 코드 디버깅 중 "Decompile source code"가 동작하는 않는 문제
1  2  3  4  5  6  7  8  9  10  11  12  13  [14]  15  ...