-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kie-issues#574 Initial ASF Jenkins CI Setup (#1090)
Co-authored-by: jstastny-cz <[email protected]>
- Loading branch information
1 parent
9833a5e
commit 3e8290f
Showing
62 changed files
with
864 additions
and
1,641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Kiegroup Kogito organization repositories CI Status | ||
|
||
This project is based on [chain-status](https://github.com/kiegroup/chain-status) and information generated thanks to [build-chain-configuration-reader](https://github.com/kiegroup/build-chain-configuration-reader) using [kogito-pipelines definition file](https://github.com/kiegroup/kogito-pipelines/blob/main/.ci/pull-request-config.yaml). | ||
This project is based on [chain-status](https://github.com/kiegroup/chain-status) and information generated thanks to [build-chain-configuration-reader](https://github.com/kiegroup/build-chain-configuration-reader) using [kogito-pipelines definition file](https://github.com/apache/incubator-kie-kogito-pipelines/blob/main/.ci/pull-request-config.yaml). | ||
|
||
Due to the retrieved information requires a `GITHUB_TOKEN` and github API has a limitation it is better to not collect the information on every request from this webpage is made. So this webpage does not really requires an application service and all the required data is stored in github pages. This information is normally retrieved, treated and stored using [chain-status/action tool](https://github.com/kiegroup/chain-status/tree/main/packages/action) which is exposed as a Github Action tool, so we can customize the job execution frequency as we need. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import org.jenkinsci.plugins.workflow.libs.Library | ||
|
||
@Library('jenkins-pipeline-shared-libraries')_ | ||
|
||
pipeline { | ||
agent { | ||
label 'ubuntu' | ||
} | ||
|
||
environment { | ||
DOCKER_CONFIG = "${WORKSPACE}/.docker" | ||
|
||
IMAGE_NAME = 'quay.io/kiegroup/kogito-ci-build' | ||
IMAGE_TAG = "${BRANCH_NAME}-build-${BUILD_NUMBER}" | ||
IMAGE_NAME_TAG = "${env.IMAGE_NAME}:${env.IMAGE_TAG}" | ||
} | ||
|
||
options { | ||
timeout(time: 60, unit: 'MINUTES') | ||
} | ||
|
||
stages { | ||
stage('Build image') { | ||
steps { | ||
script { | ||
sh 'printenv' | ||
|
||
currentBuild.displayName = env.IMAGE_TAG | ||
|
||
cloud.loginContainerRegistry('quay.io', 'quay_kiegroup_registry_token') | ||
|
||
dir('kogito-pipelines') { | ||
deleteDir() | ||
|
||
checkout scm | ||
|
||
sh """ | ||
docker build --build-arg SDKMAN_JAVA=11.0.20-tem -t ${env.IMAGE_NAME_TAG} -f apache-nodes/Dockerfile.kogito-ci-build . | ||
docker tag ${env.IMAGE_NAME_TAG} ${env.IMAGE_NAME}:${GIT_COMMIT} | ||
docker tag ${env.IMAGE_NAME_TAG} ${env.IMAGE_NAME}:${BRANCH_NAME}-latest | ||
""" | ||
|
||
sh """ | ||
docker --config ${DOCKER_CONFIG} push ${env.IMAGE_NAME_TAG} | ||
docker --config ${DOCKER_CONFIG} push ${env.IMAGE_NAME}:${GIT_COMMIT} | ||
docker --config ${DOCKER_CONFIG} push ${env.IMAGE_NAME}:${BRANCH_NAME}-latest | ||
""" | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
script { | ||
sh "rm -rf ${DOCKER_CONFIG}" | ||
sh 'docker logout quay.io' | ||
} | ||
} | ||
} | ||
} | ||
stage('Test built image') { | ||
agent { | ||
docker { | ||
image env.IMAGE_NAME_TAG | ||
args '-v /var/run/docker.sock:/var/run/docker.sock --group-add docker --group-add input --group-add render' | ||
} | ||
} | ||
steps { | ||
echo 'Debug basics' | ||
sh ''' | ||
locale | ||
printenv | ||
''' | ||
|
||
echo 'Test tools' | ||
sh ''' | ||
java -version | ||
mvn --version | ||
python --version | ||
pip --version | ||
node --version | ||
npm --version | ||
go version | ||
s2i version | ||
gh version | ||
kubectl version --client | ||
oc version --client | ||
''' | ||
|
||
echo 'Test docker' | ||
sh ''' | ||
docker info | ||
docker run hello-world | ||
''' | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.