diff --git a/Jenkinsfile b/Jenkinsfile index 4f3b8f3..5ce075a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,56 +1,25 @@ pipeline { - agent { - label 'docker-x86_64' - } - - triggers { - GenericTrigger( - genericVariables: [[key: 'ref', value: '$.ref']], - causeString: 'Triggered on $ref', - printContributedVariables: true, - printPostContent: true, - silentResponse: false, - shouldNotFlatten: false, - regexpFilterText: '$ref', - regexpFilterExpression: 'refs/heads/' + BRANCH_NAME - ) - } - - options { - disableConcurrentBuilds() - buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')) - } - - stages { - stage('Makings') { - agent { - docker { - image "schemers/chibi:head" - reuseNode true - args '--user=root' - } - } - steps { - script { - stage("one") { - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh "ls" - } - } - stage("two") { - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh "ls" - } - } - } - } + agent any + options { disableConcurrentBuilds(); buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')); } + stages { + agent { docker { image 'schemers/chibi:head'; reuseNode true; args '--user=root'; } } + steps { + script { + stage('init') { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh 'apt-get update && apt-get install -y git ca-certificates gcc make libffi-dev' + sh 'git clone https://github.com/ashinn/chibi-scheme.git --depth=1' + sh 'make -j8 -C chibi-scheme' + sh 'make -j8 -C chibi-scheme install' + sh 'snow-chibi install retropikzel.compile-r7rs' + } } - } - - - post { - success { - cleanWs() + stage('tap') { + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh 'COMPILE_R7RS=chibi compile-r7rs ' + } } + } } + } } diff --git a/Makefile b/Makefile index aa2a163..6aef1b5 100644 --- a/Makefile +++ b/Makefile @@ -77,5 +77,8 @@ retropikzel/wasm/plus.wat: retropikzel/wasm/plus.c emcc -o retropikzel/wasm/plus.js retropikzel/wasm/plus.c wasm-dis retropikzel/wasm/plus.wasm > retropikzel/wasm/plus.wat +jenkinsfile: makings.scm + makings --jenkinsfile > Jenkinsfile + clean: git clean -X -f diff --git a/makings.scm b/makings.scm index f947faf..294c9d5 100644 --- a/makings.scm +++ b/makings.scm @@ -1,16 +1,16 @@ (let ((init - `("apt-get update && apt-get install -y git ca-certificates gcc make libffi-dev" + '("apt-get update && apt-get install -y git ca-certificates gcc make libffi-dev" "git clone https://github.com/ashinn/chibi-scheme.git --depth=1" "make -j8 -C chibi-scheme" "make -j8 -C chibi-scheme install" "snow-chibi install retropikzel.compile-r7rs")) (tap (lambda (scheme) - (string-append "COMPILE_R7RS=" scheme " compile-r7rs ")))) + (list (string-append "COMPILE_R7RS=" scheme " compile-r7rs "))))) (map (lambda (scheme) `((image ,(string-append "schemers/" scheme ":head")) (stages - (init ,init) - (tap ,(tap scheme))))) + (init ,@init) + (tap ,@(tap scheme))))) '("chibi")))