Task Failed: Day 81 Jenkins Multistage Pipeline - Possible Validation Bug

Hello, my task was marked as failed but I followed all the requirements. Please review my screenshots








As far as I know, the node for this one is stapp01, and the target directory is also on that host. I think that stlb01 is not involved, although the problem statement is a bit confusing. In any event, when I did the task, it worked for me and the grader passed it.

If you want me to test your code, rather than use screenshots, it’s better to put the code in

code blocks

so that your code is accessible and is not corrupted by the editor.

please let me how to solve this.? The task is modified now and problem to pass

see if this works kodekloud-eng-100-days-devops/DAY81/Task-81-Jenkins-Pipeline-Deploy-Test.md at main · MiqdadProjects/kodekloud-eng-100-days-devops · GitHub

I’ve tried out your solution.
The reason why your challenge is failing, even though, you’ve followed all the requirements, is because in the Test stage, you are doing a grep for ‘Welcome to xFusionCorp Industries’. Ideally, yes, as per the question, this is correct. But, when you submit, they run a few tests against your solution, and those tests might not exactly have the ‘Welcome to xFusionCorp Industries’ in the index.html file. So, your job will fail, as it could not search for that exact wording. This could be one of the reason why it’s failing for you.

You can remove the grep code from the Test stage in your pipeline script and you should be good to go.

pipeline {
    agent {
        label 'stapp01'
    }

    stages {
        
        stage ('Deploy') {
            steps {
                script {
                    sh "cd /var/www/html && git pull origin master"
                }
            }
        }
        
        stage ('Test') {
            steps {
                script {
                    sh "curl -f http://stlb01:8091 "
                }
            }
        }
    }
}

Hope this helps.