jenkinsci / ansicolor-plugin

Jenkins ANSI Color Plugin
https://plugins.jenkins.io/ansicolor/
MIT License
253 stars 84 forks source link

It is not working properly when i used to send the console output in email using jenkins pipeline #279

Open saikrishna1488 opened 9 months ago

saikrishna1488 commented 9 months ago

Jenkins and plugins versions report

Environment ```text Paste the output here ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Both are amazon linux 2

Reproduction steps

I am using below jenkins pipeline

pipeline {
    agent { label 'docker_node' }
    options {
        ansiColor('css')
    }
    stages {
        stage('Run Command in Directory') {
            steps {
                script {
                    sh 'docker-compose up'
                }
            }
        }
    }
    post {
        success {
            emailext(
                to: "test@gmail.com",
                subject: "Jenkins Build ${currentBuild.currentResult}: Job ${env.JOB_NAME}",
                body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\nMore info at: ${env.BUILD_URL}",
                attachmentsPattern: '**/*.log',
                mimeType: 'text/html',
                attachLog: true 
            )
        } 
        failure {
            emailext(
                to: "test@gmail.com",
                subject: "Jenkins Build ${currentBuild.currentResult}: Job ${env.JOB_NAME}",
                body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} build ${env.BUILD_NUMBER}\nMore info at: ${env.BUILD_URL}",
                attachmentsPattern: '**/*.log',
                mimeType: 'text/html',
                attachLog: true
            )
        }
    }
}

Expected Results

Screenshot 2024-02-14 180109

Actual Results

image

Anything else?

No response

Are you interested in contributing a fix?

No response

harrypotter033 commented 7 months ago

@saikrishna1488 Hi Saikrishna, I am also trying to find the similar solution, and i am using cypress docker image for some GUI testing. I am using [Jenkins 2.375.1] and i cant use new jenkins so i am using older ansicolor plugin. not sure which ansicolor version support my jenkins. Do you able to resolve this issue and have any solution. Please let me know THank you