forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestDockerPromoteJob.groovy
39 lines (30 loc) · 1.31 KB
/
TestDockerPromoteJob.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
import jenkins.tests.BuildPipelineTest
import org.junit.Before
import org.junit.Test
class TestDockerPromoteJob extends BuildPipelineTest {
@Before
void setUp() {
String imageRepository = 'ci-runner-staging'
String imageTag = 'latest'
String accountName = 'aws_account_artifact'
String sourceImagePath = "opensearchstaging/${imageRepository}:${imageTag}"
this.registerLibTester(new CopyContainerLibTester(sourceImagePath,
"public.ecr.aws/p5f6l6i3/${imageRepository}:${imageTag}",
'ecr',
'public.ecr.aws/p5f6l6i3',
accountName))
this.registerLibTester(new CopyContainerLibTester(sourceImagePath,
"opensearchproject/${imageRepository}:${imageTag}",
'docker',
'jenkins-staging-docker-prod-token'))
super.setUp()
binding.setVariable('IMAGE_REPOSITORY', imageRepository)
binding.setVariable('IMAGE_TAG', imageTag)
binding.setVariable('AWS_ACCOUNT_ARTIFACT', accountName)
}
@Test
public void testDockerForEcrJobProduction(){
super.testPipeline("jenkins/docker-ecr/docker-ecr-promote.jenkinsfile",
"tests/jenkins/jenkinsjob-regression-files/docker-ecr/docker-ecr-promote.jenkinsfile")
}
}