Skip to content

Commit

Permalink
Run verify before deploy
Browse files Browse the repository at this point in the history
* Do not add poms as artifact if not deploy
  • Loading branch information
ozangunalp committed Jan 27, 2017
1 parent 46ef128 commit 9dfbfe9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ stage ('Build') {
} finally {
archiveArtifacts 'build/libs/*.jar'
archiveArtifacts 'build/libs/*.asc'
archiveArtifacts 'build/poms/*.pom'
if (phase == 'deploy') archiveArtifacts 'build/poms/*.xml'
if (phase == 'deploy') archiveArtifacts 'build/poms/*.asc'
junit 'build/test-results/test/*.xml'
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ uploadArchives {
}

task verify(dependsOn: build)
task deploy(dependsOn: uploadArchives)
task deploy(dependsOn: [build, uploadArchives])
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class TestJenkinsFile extends BasePipelineTest {
@Override
@Before
void setUp() throws Exception {
super.setUp()
def scmBranch = branch
binding.setVariable('scm', [
$class : 'GitSCM',
Expand All @@ -43,7 +44,6 @@ class TestJenkinsFile extends BasePipelineTest {
])
helper.registerAllowedMethod("file", [Map.class], stringInterceptor)
helper.registerAllowedMethod("archiveArtifacts", [String.class], null)
super.setUp()
}

@Test
Expand Down

0 comments on commit 9dfbfe9

Please sign in to comment.