Skip to content

[ci] add jobs to run the acceptance tests #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .ci/jobs/defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
##### GLOBAL METADATA

- meta:
cluster: devops-ci

##### JOB DEFAULTS

- job:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as above, the other properties that are part of the job map need to be indented.

project-type: pipeline
logrotate:
daysToKeep: 30
numToKeep: 100
artifactDaysToKeep: 5
artifactNumToKeep: 10
parameters:
- string:
name: branch_specifier
default: refs/heads/main
description: "the Git branch specifier to build (<branchName>, <tagName>,<commitId>, etc.)"
properties:
- github:
url: https://github.com/elastic/terraform-provider-elasticstack
- inject:
properties-content: HOME=$JENKINS_HOME
pipeline-scm:
script-path: .ci/pipelines/acceptance.groovy
scm:
- git:
credentials-id: "f6c7695a-671e-4f4f-a331-acdce44ff9ba"
reference-repo: /var/lib/jenkins/.git-references/terraform-provider-elasticstack.git
branches:
- ${branch_specifier}
url: https://github.com/elastic/terraform-provider-elasticstack
vault: []
wrappers:
- ansicolor
- timestamps
12 changes: 12 additions & 0 deletions .ci/jobs/elastic+terraform-provider-elasticstack+main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- job:
name: elastic+terraform-provider-elasticstack+main
display-name: elastic / terraform-provider-elasticstack - main
description: Main branch testing
triggers:
- github
pipeline-scm:
scm:
- git:
branches:
- main
20 changes: 20 additions & 0 deletions .ci/jobs/elastic+terraform-provider-elasticstack+pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- job:
name: elastic+terraform-provider-elasticstack+pull-request
display-name: elastic / terraform-provider-elasticstack - pull-request
description: Pull request testing
concurrent: true
triggers:
- github-pull-request:
github-hooks: true
org-list:
- elastic
allow-whitelist-orgs-as-admins: true
cancel-builds-on-update: false
status-context: acceptance
pipeline-scm:
scm:
- git:
branches:
- $ghprbActualCommit
refspec: +refs/pull/*:refs/remotes/origin/pr/*
38 changes: 38 additions & 0 deletions .ci/pipelines/acceptance.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@Library('estc') _

pipeline {
agent { label('linux && immutable && docker') }

environment {
HOME = "${env.JENKINS_HOME}"
REPOSITORY = "terraform-provider-elasticstack"
GIT_REFERENCE_REPO = "/var/lib/jenkins/.git-references/terraform-provider-elasticstack.git"
GIT_CREDENTIALS = "f6c7695a-671e-4f4f-a331-acdce44ff9ba"
}

stages {
stage('Checkout') {
options { skipDefaultCheckout() }
steps {
estcGithubCheckout(github_org: 'elastic',
repository: env.REPOSITORY,
revision: env.ghprbActualCommit ?: env.CHANGE_BRANCH ?: env.BRANCH_NAME ?: params.branch_specifier,
reference_repo: env.GIT_REFERENCE_REPO,
credentials: env.GIT_CREDENTIALS)
}
}

stage('Acceptance Tests') {
steps {
script {
dir('.') {
sh '''#!/bin/bash

make docker-testacc
'''
}
}
}
}
}
}