Hi!
Unlike the DFUnit Example Workspace my workspace looks a little bit different
The unit workspace looks like this
Code:
DFUnit
DFUnit Example Workspace
.gitignore
jenkins
But in my case the workspace looks like
Code:
AppHtml
AppSrc
etc
.gitignore
jenkins
The only way to make it work in my setup is to specify the workspace_dir as "."
The Workspace_output is "${WORKSPACE_DIR}\\Programs"
So when i try to archive and put my files in to a zip file with tar, the folowing line fails bat "tar acvf Order.zip "${WORKSPACE_OUTPUT}\\*.exe" "${WORKSPACE_OUTPUT}\\*.ws" "
But if i specify a envoronment variable like PROGRAMS_FOLDER = "Programs" and replace the WORKSPACE_OUTPUT it does work.
But why must i have the complete WORKSPACE_SWS = "${WORKSPACE_DIR}\\${WORKSPACE_NAME}.sws" when using the -x parameter of the compiler, the current folder is the root folder of the pulled data when jenkins is trying to build
The jenkinsfile of my setup
Code:
pipeline {
agent { label "Windows" }
environment {
// General
COMPILER = 'C:\\Program Files\\DataFlex 20.1\\Bin64\\DfCompConsole.exe'
}
stages {
stage("Pipeline") {
parallel {
stage("Basic CI") {
environment {
WORKSPACE_NAME = "Order Entry"
EXAMPLE_NAME = "Order"
WORKSPACE_DIR = ".\\"
WORKSPACE_OUTPUT = "${WORKSPACE_DIR}\\Programs"
WORKSPACE_SWS = "${WORKSPACE_DIR}\\${WORKSPACE_NAME}.sws"
EXAMPLE_SRC = "AppSrc\\${EXAMPLE_NAME}.src"
PROGRAMS_FOLDER = "Programs"
}
stages {
stage("Build") {
steps {
script {
bat "\"${COMPILER}\" -x\"${WORKSPACE_SWS}\" -c \"${EXAMPLE_SRC}\""
stash name: 'build', includes: "**"
}
}
}
stage("Archive") {
steps {
script {
unstash 'build'
bat "tar acvf Order.zip \"${PROGRAMS_FOLDER}\\*.exe\" \"${PROGRAMS_FOLDER}\\*.ws\" "
}
}
post {
always {
archiveArtifacts artifacts: "Order.zip", fingerprint: true
}
}
}
}
}
}
}
}
}