Skip to content

Commit

Permalink
kie-issues#574 Initial ASF Jenkins CI Setup (#504)
Browse files Browse the repository at this point in the history
Co-authored-by: radtriste <tradisso@redhat.com>
  • Loading branch information
jstastny-cz and radtriste authored Sep 19, 2023
1 parent 41b9f09 commit a3d41e6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 32 deletions.
14 changes: 2 additions & 12 deletions .ci/jenkins/Jenkinsfile.post-release
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,15 @@ import org.jenkinsci.plugins.workflow.libs.Library

pipeline {
agent {
label 'rhel8 && !built-in'
}

tools {
nodejs 'nodejs-16.2.0'
label 'ubuntu'
}

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

// parameters {
// For parameters, check into .jenkins/dsl/jobs.groovy file
// }

environment {
// Some generated env is also defined into .jenkins/dsl/jobs.groovy file

CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")
}

Expand All @@ -48,7 +38,7 @@ pipeline {
script {
dir("kogito-docs-${getBuildBranch()}") {
deleteDir()
checkout(githubscm.resolveRepository('kogito-docs', getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsID()))
checkout(githubscm.resolveRepository('incubator-kie-kogito-docs', getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsID()))
sh "git checkout ${getBuildBranch()}"

String antoraFile = 'serverlessworkflow/antora.yml'
Expand Down
18 changes: 4 additions & 14 deletions .ci/jenkins/Jenkinsfile.setup-branch
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,15 @@ import org.jenkinsci.plugins.workflow.libs.Library

pipeline {
agent {
label 'kie-rhel8 && !built-in'
}

tools {
nodejs 'nodejs-16.2.0'
label 'ubuntu'
}

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

// parameters {
// For parameters, check into .jenkins/dsl/jobs.groovy file
// }

environment {
// Some generated env is also defined into .jenkins/dsl/jobs.groovy file

CI_EMAIL_TO = credentials("${JENKINS_EMAIL_CREDS_ID}")
}

Expand Down Expand Up @@ -51,14 +41,14 @@ pipeline {

dir("kogito-docs-${getBuildBranch()}") {
deleteDir()
checkout(githubscm.resolveRepository('kogito-docs', getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsID()))
checkout(githubscm.resolveRepository('incubator-kie-kogito-docs', getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsID()))
sh "git checkout ${getBuildBranch()}"

String[] branchSplit = getBuildBranch().split("\\.")
String displayVersion = "${branchSplit[0]}.${branchSplit[1]}-RC"
String version = "${branchSplit[0]}.${branchSplit[1]}.0-SNAPSHOT"
String prereleaseStr = 'rc'
String swExamplesURL = "https://github.com/kiegroup/kogito-examples/tree/${getBuildBranch()}/serverless-workflow-examples"
String swExamplesURL = "https://github.com/apache/incubator-kie-kogito-examples/tree/${getBuildBranch()}/serverless-workflow-examples"
String antoraFile = 'serverlessworkflow/antora.yml'
String operatorVersion = "${getBuildBranch()}"

Expand Down Expand Up @@ -87,7 +77,7 @@ pipeline {
script {
dir('kogito-docs') {
deleteDir()
checkout(githubscm.resolveRepository('kogito-docs', getGitAuthor(), 'main', false, getGitAuthorCredsID()))
checkout(githubscm.resolveRepository('incubator-kie-kogito-docs', getGitAuthor(), 'main', false, getGitAuthorCredsID()))
sh 'git checkout main'

updateYaml('antora-playbook.yml') { antoraConfig ->
Expand Down
4 changes: 2 additions & 2 deletions .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
* This file is describing all the Jenkins jobs in the DSL format (see https://plugins.jenkins.io/job-dsl/)
* needed by the Kogito pipelines.
*
* The main part of Jenkins job generation is defined into the https://github.com/kiegroup/kogito-pipelines repository.
* The main part of Jenkins job generation is defined into the https://github.com/apache/incubator-kie-kogito-pipelines repository.
*
* This file is making use of shared libraries defined in
* https://github.com/kiegroup/kogito-pipelines/tree/main/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl.
* https://github.com/apache/incubator-kie-kogito-pipelines/tree/main/dsl/seed/src/main/groovy/org/kie/jenkins/jobdsl.
*/

import org.kie.jenkins.jobdsl.model.JobType
Expand Down
2 changes: 1 addition & 1 deletion .ci/jenkins/dsl/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
file=$(mktemp)
# For more usage of the script, use ./test.sh -h
curl -o ${file} https://raw.githubusercontent.com/kiegroup/kogito-pipelines/main/dsl/seed/scripts/seed_test.sh
curl -o ${file} https://raw.githubusercontent.com/apache/incubator-kie-kogito-pipelines/main/dsl/seed/scripts/seed_test.sh
chmod u+x ${file}
${file} $@
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Please make sure that your PR meets the following requirements:

- [ ] You have read the [contributions doc](https://github.com/kiegroup/kogito-docs/blob/main/CONTRIBUTING.md)
- [ ] You have read the [contributions doc](https://github.com/apache/incubator-kie-kogito-docs/blob/main/CONTRIBUTING.md)
- [ ] Pull Request title is properly formatted: `KOGITO-XYZ Subject`
- [ ] Pull Request title contains the target branch if not targeting main: `[0.9.x] KOGITO-XYZ Subject`
- [ ] The nav.adoc file has a link to this guide in the proper category
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/jenkins-tests-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
- name: DSL tests
uses: kiegroup/kie-ci/.ci/actions/dsl-tests@main
with:
main-config-file-repo: kiegroup/kogito-pipelines
main-config-file-repo: apache/incubator-kie-kogito-pipelines
main-config-file-path: .ci/jenkins/config/main.yaml
branch-config-file-repo: kiegroup/kogito-pipelines
branch-config-file-repo: apache/incubator-kie-kogito-pipelines

0 comments on commit a3d41e6

Please sign in to comment.