Jenkins Assignment– 4

Advanced Jenkins Pipeline Features

Basic Questions

  1. Create a Declarative Pipeline with three stages: Build, Test, and Deploy.
  2. Add post actions (success and failure) to a Declarative Pipeline.
  3. Use parameters in a pipeline to select a branch name.
  4. Use parameters in a pipeline to input a username.
  5. Create a pipeline that retries a failing command twice.
  6. Create a pipeline that skips a stage when a condition is false.
  7. Create a pipeline that uses when condition to run a stage only on the main branch.
  8. Use environment variables to store build information and print them in a pipeline.
  9. Configure credentials in Jenkins and use them inside a pipeline.
  10. Mask a password using Jenkins credentials inside a pipeline.
  11. Create a pipeline with parallel stages “Unit Tests” and “Integration Tests”.
  12. Create a pipeline with parallel stages that run simple echo commands.
  13. Configure the Blue Ocean plugin and open a pipeline visualization.
  14. Write a pipeline that uses the input parameter to select environment (Dev/Prod).
  15. Write a pipeline that uses the input parameter to select deployment region.
  16. Create a pipeline with a retry block for a shell command.
  17. Create a pipeline with timeout set to 3 minutes for a stage.
  18. Add a failure post action to send a message in the console output.
  19. Create a simple shared library and call a function from it in a pipeline.
  20. Store a Jenkinsfile in a GitHub repository and visualize it in Blue Ocean.

Intermediate Questions

  1. Create a pipeline with four stages: Checkout, Build, Test, Deploy.
  2. Add post actions for success, failure, and always in a pipeline.
  3. Create a shared library with a custom function and use it in two pipelines.
  4. Create a pipeline that runs three jobs in parallel.
  5. Use parameters to select which module should be built in a pipeline.
  6. Use parameters to allow users to choose between running tests or skipping tests.
  7. Create a pipeline that retries a failing stage three times.
  8. Add conditional execution so that deployment runs only if tests pass.
  9. Configure Jenkins credentials for a private GitHub repository and use it in a pipeline.
  10. Use Jenkins credentials to connect to a Docker registry inside a pipeline.
  11. Write a pipeline that uses a password parameter and keeps it masked.
  12. Create a pipeline that archives build artifacts in post actions.
  13. Use Blue Ocean to visualize a multi-stage pipeline.
  14. Create a pipeline that uses shared library steps for build and test.
  15. Create a pipeline with two parallel branches, each running different commands.
  16. Add manual input approval before deploying in a pipeline.
  17. Use an environment variable to store and print the Jenkins node name.
  18. Create a Jenkinsfile that runs tests on Linux and Windows agents in parallel.
  19. Write a pipeline that builds a project and publishes JUnit test results.
  20. Write a pipeline that uploads build artifacts to a file server using credentials.

Advanced Questions

  1. Write a Declarative Pipeline with dynamic parallel stages for multiple modules.
  2. Write a pipeline that includes success, failure, unstable, and always post actions.
  3. Implement a shared library with two functions (build and deploy) and use them.
  4. Write a pipeline that runs tests in parallel across three environments.
  5. Create a parameterized pipeline that lets users select multiple build options.
  6. Write a pipeline that retries failed test stage three times before failing.
  7. Use Jenkins credentials to pull code from GitHub and push artifacts to Nexus.
  8. Write a pipeline that masks secrets while printing logs.
  9. Create a complex pipeline with stages: Checkout → Build → Test → Deploy, using Blue Ocean visualization.
  10. Write a scripted pipeline that mixes conditional execution, parallel stages, and retries.