mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-31 06:59:32 +00:00
image_builder: split builder_docker & builder_scripts skip travis
This commit is contained in:
35
builder_docker/Jenkinsfile
vendored
Normal file
35
builder_docker/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
pipeline {
|
||||
agent any
|
||||
parameters {
|
||||
string(name: 'GWBT_REF', defaultValue: "master")
|
||||
string(name: 'GWBT_URL', defaultValue: "https://github.com/CopterExpress/clever.git")
|
||||
string(name: 'GWBT_FILE', defaultValue: "")
|
||||
string(name: 'IMAGE_NAME', defaultValue: "\$(cat ${GWBT_FILE} | jq '.repository.name' -r)-${params.GWBT_REF}.img")
|
||||
string(name: 'GWBT_EVENT', defaultValue: 'release')
|
||||
booleanParam(name: 'ONLY_PUBLISH', defaultValue: false, description: 'ONLY PUBLISH')
|
||||
string(name: 'BUILD_DIR', defaultValue: '/mnt/hdd_builder/workspace', description: 'Build workspace')
|
||||
}
|
||||
environment {
|
||||
DEBIAN_FRONTEND = 'noninteractive'
|
||||
LANG = 'C.UTF-8'
|
||||
LC_ALL = 'C.UTF-8'
|
||||
}
|
||||
stages {
|
||||
stage('Build image') {
|
||||
when { not { expression { return params.ONLY_PUBLISH } } }
|
||||
steps {
|
||||
build job: 'CopterExpress-clever-build', parameters: [[$class: 'StringParameterValue', name: 'IMAGE_NAME', value: "${params.IMAGE_NAME}"], [$class: 'StringParameterValue', name: 'IMAGE_VERSION', value: "${params.GWBT_REF}"], [$class: 'StringParameterValue', name: 'GWBT_REF', value: "${params.GWBT_REF}"], [$class: 'StringParameterValue', name: 'GWBT_URL', value: "${params.GWBT_URL}"]]
|
||||
}
|
||||
}
|
||||
stage('Publish image') {
|
||||
when { environment name: 'GWBT_EVENT', value: 'release' }
|
||||
environment {
|
||||
CONFIG_FILE = "${params.BUILD_DIR}/coex-ci.json"
|
||||
YA_SCRIPT = "$WORKSPACE/image_builder/yadisk.py"
|
||||
}
|
||||
steps {
|
||||
sh "$WORKSPACE/image_builder/image_config.sh publish_image ${params.BUILD_DIR} ${params.IMAGE_NAME} ${YA_SCRIPT} ${CONFIG_FILE} \$(cat ${params.GWBT_FILE} | jq '.release.id' -r) \"\$(cat ${params.GWBT_FILE} | jq '.release.body' | sed 's/\"//' | rev | sed 's/\"//' | rev)\""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user