Jenkins Assignment– 4
Advanced Jenkins Pipeline Features
Basic Questions
- Create a Declarative Pipeline with three stages: Build, Test, and Deploy.
- Add post actions (success and failure) to a Declarative Pipeline.
- Use parameters in a pipeline to select a branch name.
- Use parameters in a pipeline to input a username.
- Create a pipeline that retries a failing command twice.
- Create a pipeline that skips a stage when a condition is false.
- Create a pipeline that uses when condition to run a stage only on the main branch.
- Use environment variables to store build information and print them in a pipeline.
- Configure credentials in Jenkins and use them inside a pipeline.
- Mask a password using Jenkins credentials inside a pipeline.
- Create a pipeline with parallel stages “Unit Tests” and “Integration Tests”.
- Create a pipeline with parallel stages that run simple echo commands.
- Configure the Blue Ocean plugin and open a pipeline visualization.
- Write a pipeline that uses the input parameter to select environment (Dev/Prod).
- Write a pipeline that uses the input parameter to select deployment region.
- Create a pipeline with a retry block for a shell command.
- Create a pipeline with timeout set to 3 minutes for a stage.
- Add a failure post action to send a message in the console output.
- Create a simple shared library and call a function from it in a pipeline.
- Store a Jenkinsfile in a GitHub repository and visualize it in Blue Ocean.
Intermediate Questions
- Create a pipeline with four stages: Checkout, Build, Test, Deploy.
- Add post actions for success, failure, and always in a pipeline.
- Create a shared library with a custom function and use it in two pipelines.
- Create a pipeline that runs three jobs in parallel.
- Use parameters to select which module should be built in a pipeline.
- Use parameters to allow users to choose between running tests or skipping tests.
- Create a pipeline that retries a failing stage three times.
- Add conditional execution so that deployment runs only if tests pass.
- Configure Jenkins credentials for a private GitHub repository and use it in a pipeline.
- Use Jenkins credentials to connect to a Docker registry inside a pipeline.
- Write a pipeline that uses a password parameter and keeps it masked.
- Create a pipeline that archives build artifacts in post actions.
- Use Blue Ocean to visualize a multi-stage pipeline.
- Create a pipeline that uses shared library steps for build and test.
- Create a pipeline with two parallel branches, each running different commands.
- Add manual input approval before deploying in a pipeline.
- Use an environment variable to store and print the Jenkins node name.
- Create a Jenkinsfile that runs tests on Linux and Windows agents in parallel.
- Write a pipeline that builds a project and publishes JUnit test results.
- Write a pipeline that uploads build artifacts to a file server using credentials.
Advanced Questions
- Write a Declarative Pipeline with dynamic parallel stages for multiple modules.
- Write a pipeline that includes success, failure, unstable, and always post actions.
- Implement a shared library with two functions (build and deploy) and use them.
- Write a pipeline that runs tests in parallel across three environments.
- Create a parameterized pipeline that lets users select multiple build options.
- Write a pipeline that retries failed test stage three times before failing.
- Use Jenkins credentials to pull code from GitHub and push artifacts to Nexus.
- Write a pipeline that masks secrets while printing logs.
- Create a complex pipeline with stages: Checkout → Build → Test → Deploy, using Blue Ocean visualization.
- Write a scripted pipeline that mixes conditional execution, parallel stages, and retries.