From 6f089c7beeae6ff56bab626bc9cee52800e3b155 Mon Sep 17 00:00:00 2001 From: Spacelord Date: Wed, 30 Jun 2021 01:59:55 +0200 Subject: Move to Jenkins CI, introduce new CI script --- assets/ci-config | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 assets/ci-config (limited to 'assets/ci-config') diff --git a/assets/ci-config b/assets/ci-config new file mode 100644 index 0000000..5e8df68 --- /dev/null +++ b/assets/ci-config @@ -0,0 +1,73 @@ +#!/usr/bin/env groovy + +/* + * This Jenkinsfile is intended to run on https://ci.spacecdn.de and may fail anywhere else. + * It makes assumptions about plugins being installed, labels mapping to nodes that can build what is needed, etc. + */ + +def buildTypes = ['linux', 'windows'] +def builds = [:] + +//if(env.TAG_NAME) { +// buildTypes.add("debian") +//} + +buildTypes.each{ + builds["$it"] = { + node() { + skipDefaultCheckout() + stage('Checkout') { + checkout scm + } + + stage("$it Build"){ + sh label: "Build", script: "./assets/ci.sh --target=build-$it --deploy" + } + + stage('Stash artifacts') { + stash includes: "deployment/$it/*", name: "$it", allowEmpty: 'false' + } + } + } +} + +def deploy = { + node(){ + skipDefaultCheckout() + stage('Deploy') { + buildTypes.each{ + unstash "$it" + } + archiveArtifacts artifacts: 'deployment/*/*', onlyIfSuccessful: true, fingerprint: true + } + } +} + +builds.Test = { + node() { + skipDefaultCheckout() + stage('Checkout') { + checkout scm + } + stage('Test') { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh label: "Check Spelling", script: './assets/ci.sh --target=check-spelling' + } + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh label: "Check Codespelling", script: './assets/ci.sh --target=check-codespelling' + } + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh label: "Analyze Complexity", script: './assets/ci.sh --target=analyze-complexity' + } + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh label: "Analyze Shellscripts", script: './assets/ci.sh--target=analyze-shellscript' + } + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh label: "Code Statistics", script: '../assets/ci.sh --target=stats' + } + } + } +} + +parallel builds +deploy.call() \ No newline at end of file -- cgit v1.2.3 From f16f7db86662fcdbf45b6373257c90c824b0b4b0 Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 30 Jun 2021 02:53:23 +0200 Subject: Fix CI test step invocation --- assets/ci-config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'assets/ci-config') diff --git a/assets/ci-config b/assets/ci-config index 5e8df68..ac94661 100644 --- a/assets/ci-config +++ b/assets/ci-config @@ -60,14 +60,14 @@ builds.Test = { sh label: "Analyze Complexity", script: './assets/ci.sh --target=analyze-complexity' } catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh label: "Analyze Shellscripts", script: './assets/ci.sh--target=analyze-shellscript' + sh label: "Analyze Shellscripts", script: './assets/ci.sh --target=analyze-shellscript' } catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh label: "Code Statistics", script: '../assets/ci.sh --target=stats' + sh label: "Code Statistics", script: './assets/ci.sh --target=stats' } } } } parallel builds -deploy.call() \ No newline at end of file +deploy.call() -- cgit v1.2.3