pip, Jenkinsfile

This commit is contained in:
2021-07-24 16:34:13 +03:00
parent 6a9c328308
commit e0bb28560d
2 changed files with 10 additions and 3 deletions

11
Jenkinsfile vendored
View File

@@ -1,4 +1,4 @@
def build_docker(name) { def build_docker(name, release_dir) {
def image = "${name}-shstk" def image = "${name}-shstk"
echo "Build image ${image}" echo "Build image ${image}"
def pref = "" def pref = ""
@@ -12,6 +12,9 @@ def build_docker(name) {
def args = "${pref} --build-arg LIBS_BUILD_NUMBER=${env.BUILD_NUMBER} --build-arg JOBS_COUNT=${jobs}" def args = "${pref} --build-arg LIBS_BUILD_NUMBER=${env.BUILD_NUMBER} --build-arg JOBS_COUNT=${jobs}"
dir ("docker/${image}") { dir ("docker/${image}") {
sh "docker build ${args} --no-cache -t ${image} ." sh "docker build ${args} --no-cache -t ${image} ."
docker.image('${image}').inside('-v ${release_dir}:/soft/release') {
sh 'cp -vf /soft/shstk/release/* /soft/release/'
}
} }
return "\n - ${image}" return "\n - ${image}"
} }
@@ -19,6 +22,8 @@ node {
stage("checkout") { stage("checkout") {
checkout scm checkout scm
} }
def rel_dir = sh(script: "pwd", returnStdout: true) + '/release'
echo "Release to ${rel_dir}"
def _envmap = [:] def _envmap = [:]
def _env = sh(script: "env", returnStdout: true).trim().split("\n") def _env = sh(script: "env", returnStdout: true).trim().split("\n")
_env.each{ l -> _env.each{ l ->
@@ -27,16 +32,18 @@ node {
def _v = l.substring(_ind + 1); def _v = l.substring(_ind + 1);
_envmap["${_n}"] = "${_v}"; _envmap["${_n}"] = "${_v}";
} }
sh "mkdir -p ${rel_dir}"
def _msg = "Built images:" def _msg = "Built images:"
def platforms = ['debian', 'osx', 'windows', 'windows32', 'android', 'pi', 'ubuntu'] def platforms = ['debian', 'osx', 'windows', 'windows32', 'android', 'pi', 'ubuntu']
for (int i = 0; i < platforms.size(); ++i) { for (int i = 0; i < platforms.size(); ++i) {
if (_envmap["BUILD_${platforms[i]}"] == "1") { if (_envmap["BUILD_${platforms[i]}"] == "1") {
stage("${platforms[i]}-shstk") { stage("${platforms[i]}-shstk") {
_msg += build_docker("${platforms[i]}") _msg += build_docker("${platforms[i]}", rel_dir)
} }
} }
} }
sh "docker system prune -f" sh "docker system prune -f"
archiveArtifacts '${rel_dir}/*'
echo "${_msg}" echo "${_msg}"
} }
pipeline { pipeline {

2
pip

Submodule pip updated: 686c970e84...ca44846240