forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestMavenSignReleaseJob.groovy
46 lines (31 loc) · 1.5 KB
/
TestMavenSignReleaseJob.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import jenkins.tests.BuildPipelineTest
import org.junit.Before
import org.junit.Test
class TestMavenSignReleaseJob extends BuildPipelineTest {
@Before
void setUp() {
def destPath = "${this.workspace}/artifacts"
def manifestPath = "${this.workspace}/artifacts/distribution-build-opensearch/1.0.0/123/linux/x64/builds/opensearch/manifest.yml"
def artifactsPath = 'distribution-build-opensearch/1.0.0/123/linux/x64/builds/'
def bucketName = 'job-s3-bucket-name'
this.registerLibTester(new DownloadFromS3LibTester(destPath, bucketName, artifactsPath, true))
this.registerLibTester(new SignArtifactsLibTester( '.sig', 'linux', manifestPath, 'maven', null))
super.setUp()
// Variables for Maven Sign Release job
binding.setVariable('VERSION', '1.0.0')
binding.setVariable('BUILD_ID', '123')
binding.setVariable('ARTIFACT_PATH', 'distribution-build-opensearch/1.0.0/123/linux/x64/builds')
binding.setVariable('ARTIFACT_BUCKET_NAME', bucketName)
binding.setVariable('SONATYPE_STAGING_PROFILE_ID', 'dummy_id')
helper.registerAllowedMethod('checkout', [Map], {})
}
@Test
void MavenSignRelease_test() {
super.testPipeline('jenkins/opensearch-maven-release/maven-sign-release.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/maven-sign-release/maven-sign-release.jenkinsfile')
}
}