2017-02-14 15 views
0

나는 모든트래비스는 GitHub의에서 호스팅되는 자바 프로젝트를 진행 자바 받는다는 워크 플로우

을 gitflow. 코드를 개발 및 마스터 분기에서 직접 소니 타입으로 푸시하고 싶습니다. 나는 GPG 서명을 생략하기 때문에 현재

에만

내가 내 자격 증명

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 
         http://maven.apache.org/xsd/settings-1.0.0.xsd"> 
    <servers> 
     <server> 
      <!-- Maven Central Deployment --> 
      <id>ossrh</id> 
      <username>${env.SONATYPE_USERNAME}</username> 
      <password>${env.SONATYPE_PASSWORD}</password> 
     </server> 
    </servers> 
    <profiles> 
     <profile> 
      <id>ossrh</id> 
      <activation> 
       <activeByDefault>true</activeByDefault> 
      </activation> 
      <properties> 
       <gpg.executable>gpg</gpg.executable> 
       <gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase> 
      </properties> 
     </profile> 
    </profiles> 
</settings> 

travis.yml와 .travis 폴더에 setting.xml를 사용 가지 작품을 개발 다음과 같이 표시됩니다.

language: java 
jdk: 
    - oraclejdk8 

script: 
- mvn --settings .travis/settings.xml clean verify 

deploy: 
- 
    provider: script 
    script: 
    - mvn --settings .travis/settings.xml deploy -D gpg.skip -P release 
    on: 
    branch: develop 
- 
    provider: script 
    script: 
    - mvn --settings .travis/settings.xml org.codehaus.mojo:versions-maven-plugin:2.3:set -D newVersion=$TRAVIS_TAG -P release 
    - .travis/gpg.sh 
    - mvn clean deploy --settings .travis/settings.xml -D skipTests=true --batch-mode --update-snapshots -P release 
    on: 
    tags: true 

내 배포 프로필에 필요한 배포 플러그인이 포함되어 있습니다.

0.0.2과 같이 태그/릴리스를 푸는 중 오류가 발생합니다. 이 태그를 사용하여 배포를 배포 할 것으로 기대합니다.

개발 분기가 올바르게 작동하고 스냅 샷이 sonatype repo에 올바르게 배치됩니다. 여기

사전

에서

https://github.com/effectus-io/effectus-parent

감사는 트래비스가 오류를 기록합니다. 많은 시행 내가 그것을 실현 오류 후

The command "mvn --settings .travis/settings.xml clean verify" exited with 0. Skipping a deployment with the script provider because this branch is not permitted dpl.0 Fetching: dpl-1.8.31.gem (100%)Fetching: dpl-1.8.31.gem (100%) Successfully installed dpl-1.8.31 1 gem installed dpl.1 Installing deploy dependencies !!! Script support is experimental !!! Preparing deploy Cleaning up git repository with `git stash --all`. If you need build artifacts for deployment, set `deploy.skip_cleanup: true`. See https://docs.travis-ci.com/user/deployment/#Uploading-Files. No local changes to save dpl.3 Deploying application No stash found. /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/cli.rb:54:in `system': wrong first argument (ArgumentError) from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/cli.rb:54:in `shell' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/provider/script.rb:18:in `push_app' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/provider.rb:146:in `block in deploy' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/cli.rb:41:in `fold' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/provider.rb:146:in `deploy' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/cli.rb:32:in `run' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/lib/dpl/cli.rb:7:in `run' from /home/travis/.rvm/gems/ruby-1.9.3-p551/gems/dpl-1.8.31/bin/dpl:5:in `<top (required)>' from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:in `load' from /home/travis/.rvm/gems/ruby-1.9.3-p551/bin/dpl:23:in `<main>' failed to deploy

+0

어떻게 당신을 도울 수 있는지 잘 모르겠지만 DPL을 보았을 때 나는 이것을 보았습니다 : https://github.com/travis-ci/dpl/pull/466, 거기를보고 커밋이 있는지 확인하십시오 어떻게 작동시키는 지에 대한 단서를 제공합니다. – DarthHater

답변

0

시도하고 트래비스에 기호 자료에 너무 많은 일이다, 거기에 좋은 지원은 없으며, 그 수치이다.

다른 대안은 bintray ->https://bintray.com/ 을 사용하여 jar의 gpg 서명을 자동화하는 릴리스 레포를 제공하는 것입니다. 또한 sonatype과 동기화되므로 maven을 사용하는 완벽한 솔루션이라고 생각합니다.

pom에서 플러그인으로 버전 관리 자동화 ->https://github.com/effectus-io/effectus-parent/blob/master/pom.xml#L299 공지 travis에서 커밋하지 않습니다! 여기에 내 워크 플로우를 볼 수 있습니다>https://github.com/effectus-io/effectus-parent/blob/master/.travis.yml#L34

- ->https://github.com/effectus-io/effectus-parent/releases/tag/0.0.10

사용 gitflow을, 일반 자동 sonatype에 스냅 샷을 밀어 버린다 지점을 개발하기 위해 투입

나는 편의상 sonatype에 직접가는 스냅 샷을 유지했다. 릴리스 (태그 지정 후)를 사용하면 pom에서 SNAPSHOT을 제거하고 bintray에 배포 할 maven 버전 플러그인을 사용하여 빌드 및 복귀를 트리거합니다.

+0

설정 한 버전을 피하려면 ' $ {revision} '을 참조하십시오. 여기를 참조하십시오. https://axelfontaine.com/blog/dead-burried.html 트래비스의 경우 https : // dracoblue를 따라갔습니다. net/dev/uploading-snapshots-and-releases-to-maven-central-with-travis/유일한 중요한 일은 개행하지 않고 GPG 관련 env 변수를 저장하는 것이 었습니다.'gpg --export-ownertrust | base64 | tr -d '\ n'' – Karussell