Microsoft MVP성태의 닷넷 이야기
Linux: 14. 리눅스 환경에서 TFS 서버 연동 [링크 복사], [링크+제목 복사]
조회: 12104
글쓴 사람
정성태 (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)
13398정성태8/3/20234135스크립트: 55. 파이썬 - pyodbc를 이용한 SQL Server 연결 사용법
13397정성태7/23/20233642닷넷: 2134. C# - 문자열 연결 시 string.Create를 이용한 GC 할당 최소화
13396정성태7/22/20233341스크립트: 54. 파이썬 pystack 소개 - 메모리 덤프로부터 콜 스택 열거
13395정성태7/20/20233311개발 환경 구성: 685. 로컬에서 개발 중인 ASP.NET Core/5+ 웹 사이트에 대해 localhost 이외의 호스트 이름으로 접근하는 방법
13394정성태7/16/20233254오류 유형: 873. Oracle.ManagedDataAccess.Client - 쿼리 수행 시 System.InvalidOperationException
13393정성태7/16/20233420닷넷: 2133. C# - Oracle 데이터베이스의 Sleep 쿼리 실행하는 방법
13392정성태7/16/20233297오류 유형: 872. Oracle - ORA-01031: insufficient privileges
13391정성태7/14/20233368닷넷: 2132. C# - sealed 클래스의 메서드를 callback 호출했을 때 인라인 처리가 될까요?
13390정성태7/12/20233339스크립트: 53. 파이썬 - localhost 호출 시의 hang 현상
13389정성태7/5/20233322개발 환경 구성: 684. IIS Express로 호스팅하는 웹을 WSL 환경에서 접근하는 방법
13388정성태7/3/20233512오류 유형: 871. 윈도우 탐색기에서 열리지 않는 zip 파일 - The Compressed (zipped) Folder '[...].zip' is invalid. [1]파일 다운로드1
13387정성태6/28/20233531오류 유형: 870. _mysql - Commands out of sync; you can't run this command now
13386정성태6/27/20233601Linux: 61. docker - 원격 제어를 위한 TCP 바인딩 추가
13385정성태6/27/20233817Linux: 60. Linux - 외부에서의 접속을 허용하기 위한 TCP 포트 여는 방법
13384정성태6/26/20233565.NET Framework: 2131. C# - Source Generator로 해결하는 enum 박싱 문제파일 다운로드1
13383정성태6/26/20233313개발 환경 구성: 683. GPU 런타임을 사용하는 Colab 노트북 설정
13382정성태6/25/20233356.NET Framework: 2130. C# - Win32 API를 이용한 윈도우 계정 정보 (예: 마지막 로그온 시간)파일 다운로드1
13381정성태6/25/20233741오류 유형: 869. Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
13380정성태6/24/20233195스크립트: 52. 파이썬 3.x에서의 동적 함수 추가
13379정성태6/23/20233209스크립트: 51. 파이썬 2.x에서의 동적 함수 추가
13378정성태6/22/20233094오류 유형: 868. docker - build 시 "CANCELED ..." 뜨는 문제
13377정성태6/22/20236892오류 유형: 867. 파이썬 mysqlclient 2.2.x 설치 시 "Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually" 오류
13376정성태6/21/20233282.NET Framework: 2129. C# - Polly를 이용한 클라이언트 측의 요청 재시도파일 다운로드1
13375정성태6/20/20232983스크립트: 50. Transformers (신경망 언어모델 라이브러리) 강좌 - 2장 코드 실행 결과
13374정성태6/20/20233110오류 유형: 866. 파이썬 - <class 'AttributeError'> module 'flask.json' has no attribute 'JSONEncoder'
13373정성태6/19/20234398오류 유형: 865. 파이썬 - pymssql 설치 관련 오류 정리
1  2  3  4  5  6  7  8  [9]  10  11  12  13  14  15  ...