Skip to content

Commit 71b0c70

Browse files
authored
Merge pull request #1 from elastic/chore/ci-integration
[ci] add jobs to run the acceptance tests
2 parents 0175bc0 + f662b47 commit 71b0c70

File tree

4 files changed

+108
-0
lines changed

4 files changed

+108
-0
lines changed

.ci/jobs/defaults.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
##### GLOBAL METADATA
3+
4+
- meta:
5+
cluster: devops-ci
6+
7+
##### JOB DEFAULTS
8+
9+
- job:
10+
project-type: pipeline
11+
logrotate:
12+
daysToKeep: 30
13+
numToKeep: 100
14+
artifactDaysToKeep: 5
15+
artifactNumToKeep: 10
16+
parameters:
17+
- string:
18+
name: branch_specifier
19+
default: refs/heads/main
20+
description: "the Git branch specifier to build (<branchName>, <tagName>,<commitId>, etc.)"
21+
properties:
22+
- github:
23+
url: https://github.com/elastic/terraform-provider-elasticstack
24+
- inject:
25+
properties-content: HOME=$JENKINS_HOME
26+
pipeline-scm:
27+
script-path: .ci/pipelines/acceptance.groovy
28+
scm:
29+
- git:
30+
credentials-id: "f6c7695a-671e-4f4f-a331-acdce44ff9ba"
31+
reference-repo: /var/lib/jenkins/.git-references/terraform-provider-elasticstack.git
32+
branches:
33+
- ${branch_specifier}
34+
url: https://github.com/elastic/terraform-provider-elasticstack
35+
vault: []
36+
wrappers:
37+
- ansicolor
38+
- timestamps
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
- job:
3+
name: elastic+terraform-provider-elasticstack+main
4+
display-name: elastic / terraform-provider-elasticstack - main
5+
description: Main branch testing
6+
triggers:
7+
- github
8+
pipeline-scm:
9+
scm:
10+
- git:
11+
branches:
12+
- main
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
- job:
3+
name: elastic+terraform-provider-elasticstack+pull-request
4+
display-name: elastic / terraform-provider-elasticstack - pull-request
5+
description: Pull request testing
6+
concurrent: true
7+
triggers:
8+
- github-pull-request:
9+
github-hooks: true
10+
org-list:
11+
- elastic
12+
allow-whitelist-orgs-as-admins: true
13+
cancel-builds-on-update: false
14+
status-context: acceptance
15+
pipeline-scm:
16+
scm:
17+
- git:
18+
branches:
19+
- $ghprbActualCommit
20+
refspec: +refs/pull/*:refs/remotes/origin/pr/*

.ci/pipelines/acceptance.groovy

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
@Library('estc') _
2+
3+
pipeline {
4+
agent { label('linux && immutable && docker') }
5+
6+
environment {
7+
HOME = "${env.JENKINS_HOME}"
8+
REPOSITORY = "terraform-provider-elasticstack"
9+
GIT_REFERENCE_REPO = "/var/lib/jenkins/.git-references/terraform-provider-elasticstack.git"
10+
GIT_CREDENTIALS = "f6c7695a-671e-4f4f-a331-acdce44ff9ba"
11+
}
12+
13+
stages {
14+
stage('Checkout') {
15+
options { skipDefaultCheckout() }
16+
steps {
17+
estcGithubCheckout(github_org: 'elastic',
18+
repository: env.REPOSITORY,
19+
revision: env.ghprbActualCommit ?: env.CHANGE_BRANCH ?: env.BRANCH_NAME ?: params.branch_specifier,
20+
reference_repo: env.GIT_REFERENCE_REPO,
21+
credentials: env.GIT_CREDENTIALS)
22+
}
23+
}
24+
25+
stage('Acceptance Tests') {
26+
steps {
27+
script {
28+
dir('.') {
29+
sh '''#!/bin/bash
30+
31+
make docker-testacc
32+
'''
33+
}
34+
}
35+
}
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)