2012-03-12 4 views
0

github에서 내 프로젝트를 끌어와 빌드하고 빌드 상태를보고하는 간단한 젠킨스 빌드가 있습니다.젠킨스 빌드 성공시 jar를 github에 푸시

결과 JAR 파일을 프로젝트의 TARGET-SNAPSHOTS 브랜치에 게시하도록 Jenkins를 구성하고 싶습니다.

현재 내 프로젝트 .gitignore의/대상/*

내가 GitPublisher보고했지만이 아니라 그냥 jar 파일보다 전체 빌드를 밀어 나타납니다.

이 작업을 수행하는 가장 좋은 방법에 대한 생각이 있다면 가능합니까?

감사합니다.

+0

당신이 당신의 프로젝트를 빌드 받는다는 사용하고 있습니까? –

+0

기존의 repo에 파일을 추가하고 변경 사항을 적용하거나 GitHub의 다운로드 섹션에 파일을 추가하려고합니까? –

+0

@brian - 예 - 프로젝트를 빌드 할 때 maven을 사용하고 있습니다. – empire29

답변

1

, 당신이 사용할 수있는

Post build task

간단한 스크립트 참조 github 다운로드 플러그인 - https://github.com/github/maven-plugins. 빌드의 일부로 Riak Java 클라이언트를 다운로드 섹션에 배치하는 데이 파일을 사용합니다. 당신의 ~/.m2/Settings.XML의에서

이 필요합니다

<profile> 
    <id>githubUpload</id> 
    <activation> 
    <property> 
     <name>github.downloads</name> 
     <value>true</value> 
    </property> 
    </activation> 
    <build> 
    <plugins> 
     <plugin> 
     <groupId>com.github.github</groupId> 
     <artifactId>downloads-maven-plugin</artifactId> 
     <version>0.4</version> 
     <configuration> 
      <description>${project.version} release of ${project.name}</description> 
      <override>false</override>    
      <includeAttached>true</includeAttached> 
     </configuration> 
     <executions> 
      <execution> 
      <goals> 
       <goal>upload</goal> 
      </goals> 
      <phase>install</phase> 
      </execution> 
     </executions> 
     </plugin> 
    </plugins> 
    </build> 
</profile> 

(필자는 설치의 일부로하고 있어요 : 같은 프로젝트의 .pom 뭔가 그런

<settings> 
    <profiles> 
    <profile> 
     <id>github</id> 
     <properties> 
     <github.global.userName>YourGithubUser</github.global.userName> 
     <github.global.password>YourGithubPass</github.global.password> 
     </properties> 
    </profile> 
    </profiles> 
    <activeProfiles> 
    <activeProfile>github</activeProfile> 
    </activeProfiles> 
</settings> 

단계는 - 당신이 원하는 그러나 당신은) 할 수

그리고 단순히 받는다는 빌드에 -Dgithub.downloads=true를 추가 -

mvn install -Dgithub.downloads=true

플러그인의 웹 페이지 등의 파일을 제외/포함 모든 옵션을 나열

2

많은 가능성이 있다고 생각합니다. 그 중 하나는 빌드 후 스크립트를 실행하는 것입니다. 쉘이라면 쓸 수 있습니다. 다른

find . -name "*.jar" -exec scp {} [email protected]:/path/for/build/${BUILD_TAG} \; 

: 당신이 받는다는을 사용하고 github의 다운로드 섹션이 허용 말했다 때문에

Publish Over ... (ssh, ftp, cifs)

+0

나는 그것을 시도 할 것이다 - 나는 당신이 SCP를 github 할 수 있다는 것을 깨달았다. 감사 – empire29

관련 문제