Fix Jenkins pipeline workspace paths and cleanWs error

- Remove cleanWs from post section to avoid context errors
- Fix all workspace paths to use current directory (.)
- Pipeline should now run properly on Jenkins agent
This commit is contained in:
RebeccaNod1 2025-08-10 09:24:01 -05:00
parent 0ababdce92
commit cae6d16699

13
Jenkinsfile vendored
View file

@ -24,7 +24,7 @@ pipeline {
steps { steps {
echo "🔧 Validating LSL syntax..." echo "🔧 Validating LSL syntax..."
sh ''' sh '''
python3 ${LSL_TOOLS_PATH}/lsl_validator.py /workspace/${PROJECT_NAME}/ python3 ${LSL_TOOLS_PATH}/lsl_validator.py .
''' '''
} }
post { post {
@ -47,7 +47,6 @@ pipeline {
steps { steps {
echo "🔄 Preprocessing LSL files..." echo "🔄 Preprocessing LSL files..."
sh ''' sh '''
cd /workspace/${PROJECT_NAME}
for file in *.lsl; do for file in *.lsl; do
if [[ -f "$file" ]]; then if [[ -f "$file" ]]; then
echo "Processing $file..." echo "Processing $file..."
@ -65,8 +64,6 @@ pipeline {
steps { steps {
echo "📦 Creating release package..." echo "📦 Creating release package..."
sh ''' sh '''
cd /workspace/${PROJECT_NAME}
# Get version from git tag or use build number # Get version from git tag or use build number
VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "v2.6.${BUILD_NUMBER}") VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "v2.6.${BUILD_NUMBER}")
echo "Creating release ${VERSION}" echo "Creating release ${VERSION}"
@ -96,7 +93,7 @@ pipeline {
// Create GitHub release (if using GitHub plugin) // Create GitHub release (if using GitHub plugin)
script { script {
def version = sh(script: "cd /workspace/${PROJECT_NAME} && git describe --tags --abbrev=0 2>/dev/null || echo 'v2.6.${BUILD_NUMBER}'", returnStdout: true).trim() def version = sh(script: "git describe --tags --abbrev=0 2>/dev/null || echo 'v2.6.${BUILD_NUMBER}'", returnStdout: true).trim()
echo "Release ${version} created successfully!" echo "Release ${version} created successfully!"
} }
} }
@ -109,8 +106,6 @@ pipeline {
steps { steps {
echo "📚 Updating project documentation..." echo "📚 Updating project documentation..."
sh ''' sh '''
cd /workspace/${PROJECT_NAME}
# Generate function list from LSL files # Generate function list from LSL files
echo "# Project Functions" > FUNCTIONS.md echo "# Project Functions" > FUNCTIONS.md
echo "" >> FUNCTIONS.md echo "" >> FUNCTIONS.md
@ -152,8 +147,8 @@ pipeline {
post { post {
always { always {
echo "🧹 Cleaning up workspace..." echo "🧹 Pipeline completed"
cleanWs(cleanWhenAborted: false, cleanWhenFailure: false, cleanWhenNotBuilt: false, cleanWhenSuccess: true, cleanWhenUnstable: false) // cleanWs moved to individual stages if needed
} }
failure { failure {