Skip to content
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

Add CI job for nightly builds #1248

Merged
merged 6 commits into from
Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 4 additions & 2 deletions .ci/jobs/gke-e2e-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
artifactNumToKeep: 10
name: cloud-on-k8s-versions-gke
project-type: pipeline
triggers:
- timed: '0 0 * * 1-5'
parameters:
- string:
name: IMAGE
description: "Docker image with ECK"
pipeline-scm:
scm:
- git:
Expand Down
21 changes: 21 additions & 0 deletions .ci/jobs/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- job:
description: Job that build nightly images of ECK. This Job is managed by JJB.
logrotate:
daysToKeep: 7
numToKeep: 100
artifactDaysToKeep: 5
artifactNumToKeep: 10
name: cloud-on-k8s-nightly
project-type: pipeline
triggers:
- timed: '0 0 * * 1-5'
pipeline-scm:
scm:
- git:
url: https://github.com/elastic/cloud-on-k8s
branches:
- master
credentials-id: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba'
script-path: build/ci/nightly/Jenkinsfile
lightweight-checkout: true
8 changes: 5 additions & 3 deletions build/ci/e2e/GKE_k8s_versions.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ pipeline {
VAULT_SECRET_ID = credentials('vault-secret-id')
REGISTRY = "eu.gcr.io"
GCLOUD_PROJECT = credentials('k8s-operators-gcloud-project')
OPERATOR_IMAGE = "${IMAGE}"
LATEST_RELEASED_IMG = "${IMAGE}"
}

stages {
Expand All @@ -26,7 +28,7 @@ pipeline {
}
steps {
checkout scm
sh 'make -C build/ci ci-e2e'
sh 'make -C build/ci ci-e2e-rc'
}
}
stage("1.12") {
Expand All @@ -39,7 +41,7 @@ pipeline {
}
steps {
checkout scm
sh 'make -C build/ci ci-e2e'
sh 'make -C build/ci ci-e2e-rc'
}
}
stage("1.13") {
Expand All @@ -52,7 +54,7 @@ pipeline {
}
steps {
checkout scm
sh 'make -C build/ci ci-e2e'
sh 'make -C build/ci ci-e2e-rc'
}
}
}
Expand Down
58 changes: 58 additions & 0 deletions build/ci/nightly/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
pipeline {

agent {
label 'linux'
}

options {
timeout(time: 1, unit: 'HOURS')
}

environment {
VAULT_ADDR = credentials('vault-addr')
VAULT_ROLE_ID = credentials('vault-role-id')
VAULT_SECRET_ID = credentials('vault-secret-id')
GCLOUD_PROJECT = credentials('k8s-operators-gcloud-project')
REGISTRY = "push.docker.elastic.co"
REPOSITORY = "eck-snapshots"
IMG_NAME = "eck-operator"
IMG_SUFFIX = ""
SNAPSHOT_RELEASE = "true"
DOCKER_IMAGE_NO_TAG = "docker.elastic.co/${REPOSITORY}/${IMG_NAME}"
}

stages {
stage('Run unit and integration tests') {
steps {
sh 'make -C build/ci ci-pr'
}
}
stage('Build and push Docker image') {
steps {
sh """
export TAG_NAME=\$(date +%F)
make -C build/ci ci-release
"""
}
}
}

post {
success {
script {
def version = sh(returnStdout: true, script: 'cat $WORKSPACE/operators/VERSION')
def date = new Date()
def image = env.DOCKER_IMAGE_NO_TAG + ":" + version + "-SNAPSHOT-" + date.format("yyyy-MM-dd")
currentBuild.description = image

build job: 'cloud-on-k8s-versions-gke',
parameters: [string(name: 'IMAGE', value: image)],
wait: false
}
}
cleanup {
cleanWs()
}
}

}
2 changes: 1 addition & 1 deletion operators/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ GKE_CLUSTER_VERSION ?= 1.12

REPOSITORY ?= eck
NAME ?= eck-operator
VERSION ?= 0.9.0-SNAPSHOT
VERSION ?= $(shell cat VERSION)-SNAPSHOT
SNAPSHOT ?= true

LATEST_RELEASED_IMG ?= "docker.elastic.co/eck/$(NAME):0.8.0"
Expand Down
1 change: 1 addition & 0 deletions operators/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.9.0