build: Add Jenkinsfile for Spark
This commit is contained in:
1 parent
9e4354fb55
commit
5a2c15d4be
1 file changed
+65
@@ -0,0 +1,65 @@
|
||||
pipeline {
|
||||
agent {
|
||||
label 'os=windows && ram=8gb && installed=vs2022 && installed=python3'
|
||||
}
|
||||
|
||||
parameters {
|
||||
booleanParam(name: 'CLEAN', defaultValue: false, description: 'Perform a clean build')
|
||||
booleanParam(name: 'CLEAN_VENV', defaultValue: false, description: 'Create the python venv from scratch (delete existing)')
|
||||
gitParameter name: 'TAG', type: 'PT_BRANCH_TAG', defaultValue: 'origin/spark_crypto.prod'
|
||||
}
|
||||
stages {
|
||||
stage('Build') {
|
||||
steps {
|
||||
checkout([
|
||||
$class: 'GitSCM',
|
||||
branches: [[name: "${params.TAG}"]],
|
||||
extensions: [
|
||||
[
|
||||
$class: 'SubmoduleOption',
|
||||
disableSubmodules: false,
|
||||
recursiveSubmodules: true,
|
||||
trackingSubmodules: true,
|
||||
parentCredentials: true,
|
||||
shallow: true,
|
||||
depth: 128,
|
||||
],
|
||||
[
|
||||
$class: 'Clone',
|
||||
shallow: true,
|
||||
depth: 128,
|
||||
],
|
||||
[
|
||||
$class: 'PruneStaleBranch'
|
||||
]
|
||||
],
|
||||
userRemoteConfigs: [[url: "https://john_colvin:ATBBLTcLcmD4ysvbC8D9j5sXhpMAF4312F8F@bitbucket.org/bluetradesys/spark.git"]]
|
||||
])
|
||||
script {
|
||||
// Python venv
|
||||
if ("${params.CLEAN_VENV}") {
|
||||
echo "Cleaning python virtual environment..."
|
||||
bat "@call rmdir /s /q .venv > nul 2>&1"
|
||||
}
|
||||
bat '@call tools\\ensure_venv.cmd'
|
||||
// Main build
|
||||
if ("${params.CLEAN}") {
|
||||
echo "Cleaning build"
|
||||
bat "@call rmdir /s /q .venv > nul 2>&1"
|
||||
}
|
||||
bat '@call tools\\jenkins_build_spark.cmd --target publish'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Archive') {
|
||||
steps {
|
||||
dir ('build\\Release\\bin\\net7.0-windows\\win-x64') {
|
||||
bat """
|
||||
"C:\\Program Files\\7-Zip\\7z.exe" a -tzip ..\\..\\..\\..\\..\\spark.zip publish
|
||||
"""
|
||||
}
|
||||
archiveArtifacts artifacts: 'spark.zip', followSymlinks: false, onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user