2014-01-18 2 views
2

내 MSBuild 스크립트의 일부로 Git 체크인을 추가하려고합니다. (가) MSBuild 스크립트에 힘내를 어떻게 추가합니까?

  • 태그 빌드
  • 밀어
  • 빌드 스크립트가 ./Build/에있는 태그 (커밋

    1. 는 메시지와 함께
    2. 밀어 파일을 커밋 내가 원하는 : 여기서.는 솔루션 폴더입니다).

      내가 사용 :

      <Target Name="Committed" DependsOnTargets="SignedInstaller"> 
          <Exec Command="&quot;$(GitInstallationFolderPath)cmd\git.exe&quot; --git-dir=..\.git --work-tree=.. commit -m &quot;$(Changes)&quot;"/> 
          <Exec Command="&quot;$(GitInstallationFolderPath)cmd\git.exe&quot; --git-dir=..\.git --work-tree=.. push"/> 
          <Exec Command="&quot;$(GitInstallationFolderPath)cmd\git.exe&quot; --git-dir=..\.git --work-tree=.. tag -a v$(VersionNumber) -m &quot;$(Changes)&quot;"/> 
          <Exec Command="&quot;$(GitInstallationFolderPath)cmd\git.exe&quot; --git-dir=..\.git --work-tree=.. push -- tags"/> 
      </Target> 
      

      사용자 지정 속성은 모두 OK입니다.

      첫 번째 커밋은 1로 끝나고 빌드가 중단됩니다.

      내가 이것을 조정할 필요가 있는지, 아니면 내가 잘못 생각하고 있는지 잘 모르겠다. 그래서 조언을 환영 할 것이다. Git에 새 파일을 추가하려면 일부 작업을 수행해야합니다. MSBuild를 고수하고 싶습니다만, 지금은 많은 스크립트가 있습니다. 난 그냥 내 SVN 대상을 제거하고 힘내로 이동 싶습니다.

    +0

    저는 bash 터미널 (mingw32, cygwin)의 인스턴스를 시작해야한다고 생각합니다. 그런 다음 터미널을 통해 Git 명령을 실행하십시오. – Joe

    +0

    https://github.com/WilbertOnGithub/MSBuildGitTasks 이미 Git 명령을 MSBuild에 통합하는 프로젝트가 있으므로 에 전화 할 필요가 없을 것입니다. –

    +0

    답변 해 주셔서 감사합니다. 나는 이것을 보았지만, 문서를 오해하고있는 한 복제 작업이 하나 밖에없는 것처럼 보입니다. – dommer

    답변

    1

    MSBuild Extensions에있는 GitTask의 제한된 기능과 달리 Community Tasks에는보다 일반적인 용도가있는 것으로 보입니다.

    GitBranch A task to get the name of the branch or tag of git repository 
    GitClient A task for Git commands. 
    GitCommits A task for git to retrieve the number of commits on a revision. 
    GitDescribe  A task for git to get the most current tag, commit count since tag, and commit hash. 
    GitPendingChanges A task for git to detect if there are pending changes 
    GitVersion A task for git to get the current commit hash. 
    
    관련 문제