2014-04-23 5 views
2

Jenkins, SCM, Nexus 및 Android-Gradle의 지속적인 개선에서 시작합니다. Gradle에서 Nexus 저장소에 AAR 파일을 업로드하는 작업이 있으며 내 컴퓨터에서 실행하면 작동합니다. 이 작업은 '를 설치'하고 Gradle을 코드는 다음과 같습니다 :Gradle and Jenkins (Nexus)의 Nexus 사용자

// upload to our nexus repository 
uploadArchives { 
    repositories { 
     // the maven plugin features this deployer 
     mavenDeployer { 
      // we deploy to the release repository in this case 
      repository(url: "https://nexus1.xxxxx.com/nexus/content/repositories/releases") { 
       authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) 
      } 

      // pom project information 
      pom.project { 
       version android.defaultConfig.versionName 
       artifactId 't21-android-commons-utils' 
       name 'T21 Android Commons Utils Lib' 
       packaging 'aar' 
      } 
     } 
    } 
} 
task install(dependsOn: uploadArchives) 

인증 기능이 getRepositoryUsername을 (호출)getRepositoryPassword()gradle.properties에서 자격 증명을 읽을 수 있습니다. 하지만 SCM에이 파일을 공개하고 싶지는 않습니다. 안전하지 않아야합니다.

코드를 SCM에 푸시하면 Jenkins가이를 인식하고 '설치'을 포함하여 일부 작업을 수행하는 작업을 실행합니다. 올바르게 작동하지만 설치은 (예상대로) gradle.properties을 찾을 수 없으므로 Nexus 서버에 인증 할 수 없습니다.

젠킨스의 ' 설치'에서 인증을 어떻게해야하는지 알고 싶습니다.

Nexus에서 권한을 가진 일반 Jenkins-User를 만들려고하고 있지만 gradle 및 Jenkins를 어떻게 호출 할 수 있는지 알지 못합니다.

나는 설명하기를 희망한다. 내 불쌍한 영어에 대한 죄송합니다 ...

답변

5

나는 직접 답변드립니다.

-Pparameter = value으로 매개 변수를 전달할 수 있으며 유용합니다. 젠킨스 직업의 스위치 상자에 넣었습니다.

이제 Jenkins Job에는 자격 증명이 있지만 SCM에는 자격 증명이 없으므로 소스 코드는 자격 증명이 필요 없습니다.

+0

일단 권리가 있으면 만족스러운 답변을 수락해야합니다. –