Skip to content

Commit

Permalink
Update pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
radtriste committed Sep 8, 2023
1 parent 6831e85 commit d109aaf
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 45 deletions.
10 changes: 4 additions & 6 deletions .ci/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@ testsFailed = false

pipeline {
agent {
label 'kogito-jenkins-node && !master'
}
tools {
go 'golang-1.19'
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}
options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10')
timeout(time: 12, unit: 'HOURS') // We give a lot of time to timeout due to the lock on Openshift
}
environment {
OPENSHIFT_INTERNAL_REGISTRY = 'image-registry.openshift-image-registry.svc:5000'

CONTAINER_ENGINE = 'podman'
}
stages {
stage('Setup pipeline') {
Expand Down
20 changes: 8 additions & 12 deletions .ci/jenkins/Jenkinsfile.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,20 @@ commitDone = false

pipeline {
agent {
label 'ubuntu'
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

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

tools {
go 'golang-1.19'
}

environment {
KOGITO_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

// Linked to node label
// Use docker due to multiplatform build
CONTAINER_ENGINE = 'docker'
CONTAINER_ENGINE_TLS_OPTIONS = ''

PR_BRANCH_HASH = "${util.generateHash(10)}"

IMAGE_BUILD_PLATFORMS = 'linux/amd64,linux/arm64'
Expand Down Expand Up @@ -61,6 +55,8 @@ pipeline {

// Prepare for multiplatform build
String localRegistry = cloud.startLocalRegistry()

// TODO docker buildx could be preinstalled onto the docker image
cloud.prepareForDockerMultiplatformBuild([localRegistry],[cloud.getDockerIOMirrorRegistryConfig()], false)
cloud.installSkopeo()
}
Expand Down Expand Up @@ -277,8 +273,8 @@ String getTempBuiltImageTag() {
return "localhost:5000/kogito-serverless-operator:${getOperatorVersion()}"
}

def runPythonCommand(String cmd, boolean stdout = false) {
return util.runWithPythonVirtualEnv(cmd, 'cekit', stdout)
void runPythonCommand(String cmd, boolean stdout = false) {
return sh(returnStdout: stdout, script: cmd)
}

void pushFinalImage(String oldImageName, String newImageName) {
Expand Down
15 changes: 4 additions & 11 deletions .ci/jenkins/Jenkinsfile.e2e.cluster
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,17 @@ openshiftClusterPlatform = 'openshift'

pipeline {
agent {
label "${env.AGENT_LABEL ?: "rhel8"} && podman && !built-in"
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

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

tools {
go 'golang-1.19'
}

environment {
// Linked to node label
CONTAINER_ENGINE='podman'
CONTAINER_ENGINE_TLS_OPTIONS='--tls-verify=false'
}

stages {
stage('Setup pipeline') {
steps {
Expand Down
14 changes: 4 additions & 10 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,21 @@ helper = null

pipeline {
agent {
label 'ubuntu'
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

options {
timeout(time: 120, unit: 'MINUTES')
timestamps()
}

tools {
go 'golang-1.19'
}

environment {
KOGITO_CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")

// Linked to node label
CONTAINER_ENGINE = 'podman'
CONTAINER_ENGINE_TLS_OPTIONS = '--tls-verify=false'

PR_BRANCH_HASH = "${util.generateHash(10)}"
GITHUB_REPO = "${REPO_NAME}" // for github-release cli
}

stages {
Expand Down
9 changes: 4 additions & 5 deletions .ci/jenkins/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ testsFailed = false

pipeline {
agent {
label 'ubuntu'
}

tools {
go 'golang-1.19'
docker {
image env.AGENT_DOCKER_BUILDER_IMAGE
args env.AGENT_DOCKER_BUILDER_ARGS
}
}

options {
Expand Down
4 changes: 4 additions & 0 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ setupPromoteJob(JobType.RELEASE)

void createSetupBranchJob() {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-serverless-operator', JobType.SETUP_BRANCH, "${jenkins_path}/Jenkinsfile.setup-branch", 'Kogito Serverless Cloud Operator Setup Branch')
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",
REPO_NAME: 'kogito-serverless-operator',
Expand All @@ -67,6 +68,7 @@ void createSetupBranchJob() {

void setupDeployJob(JobType jobType) {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-serverless-operator-deploy', jobType, "${jenkins_path}/Jenkinsfile.deploy", 'Kogito Serverless Cloud Operator Deploy')
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",

Expand Down Expand Up @@ -115,6 +117,7 @@ void setupDeployJob(JobType jobType) {

void setupPromoteJob(JobType jobType) {
def jobParams = JobParamsUtils.getBasicJobParams(this, 'kogito-serverless-operator-promote', jobType, "${jenkins_path}/Jenkinsfile.promote", 'Kogito Serverless Cloud Operator Promote')
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",
MAX_REGISTRY_RETRIES: 3,
Expand Down Expand Up @@ -162,6 +165,7 @@ void setupPromoteJob(JobType jobType) {

void setupE2EJob(JobType jobType, String clusterName, Map extraEnv = [:]) {
def jobParams = JobParamsUtils.getBasicJobParams(this, "kogito-serverless-operator.e2e.${clusterName}", jobType, "${jenkins_path}/Jenkinsfile.e2e.cluster", 'Kogito Serverless Cloud Operator Deploy')
JobParamsUtils.setupJobParamsAgentDockerBuilderImageConfiguration(this, jobParams)
jobParams.env.putAll([
JENKINS_EMAIL_CREDS_ID: "${JENKINS_EMAIL_CREDS_ID}",
CLUSTER_NAME: clusterName,
Expand Down
2 changes: 1 addition & 1 deletion .ci/jenkins/scripts/minikube.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
minikubeVersion = env.MINIKUBE_VERSION ?: '1.30.1'
minikubeKubernetesVersion = env.KUBERNETES_VERSION ?: '1.26.3'
minikubeContainerEngine = env.CONTAINER_ENGINE ?: 'podman'
minikubeContainerEngine = env.CONTAINER_ENGINE ?: 'docker'

minikubeCpus = 'max'
minikubeMemory = '4g'
Expand Down

0 comments on commit d109aaf

Please sign in to comment.