0
0
Jenkinsdevops~10 mins

Build, test, deploy stages concept in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a Jenkins pipeline with a build stage.

Jenkins
pipeline {
  agent any
  stages {
    stage('Build') {
      steps {
        [1] 'echo Building the project'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Acommand
Brun
Csh
Dexecute
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' or 'execute' which are not Jenkins pipeline steps.
Forgetting to use a step to run shell commands.
2fill in blank
medium

Complete the code to add a test stage that runs tests using a shell command.

Jenkins
pipeline {
  agent any
  stages {
    stage('Test') {
      steps {
        [1] 'echo Running tests'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aexecute
Bcommand
Crun
Dsh
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent steps like 'execute' or 'run'.
Not using a step to run shell commands.
3fill in blank
hard

Fix the error in the deploy stage by completing the code to run a shell command.

Jenkins
pipeline {
  agent any
  stages {
    stage('Deploy') {
      steps {
        [1] 'echo Deploying application'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Ash
Bexecute
Crun
Dcommand
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid steps like 'execute' or 'run'.
Omitting the step to run shell commands.
4fill in blank
hard

Fill both blanks to create a pipeline with build and test stages that run shell commands.

Jenkins
pipeline {
  agent any
  stages {
    stage('Build') {
      steps {
        [1] 'echo Building'
      }
    }
    stage('Test') {
      steps {
        [2] 'echo Testing'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Ash
Brun
Cexecute
Dcommand
Attempts:
3 left
💡 Hint
Common Mistakes
Using different or invalid steps for build and test stages.
Forgetting to use a step to run shell commands.
5fill in blank
hard

Fill all three blanks to create a full pipeline with build, test, and deploy stages running shell commands.

Jenkins
pipeline {
  agent any
  stages {
    stage('Build') {
      steps {
        [1] 'echo Build started'
      }
    }
    stage('Test') {
      steps {
        [2] 'echo Test started'
      }
    }
    stage('Deploy') {
      steps {
        [3] 'echo Deploy started'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Ash
Brun
Cexecute
Dcommand
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing different steps for different stages.
Using invalid steps that cause errors.