Ravindra BagaleCourses & study guides मराठी

Ravi Sir's Cards › DevOps

Chapter 25: Shared Libraries, Credentials and Environments: Cards

मराठी cards · Open the chapter

Revision cards

Why a shared library. Copying the same pipeline code into many repos means many places to fix.
Revision card 1 of 6: Why a shared library · Download PNG · Open card page

Lesson: 25.1 Why a library

The three folders of a shared library. Jenkins only finds library code in the expected folders.
Revision card 2 of 6: The three folders of a shared library · Download PNG · Open card page

Lesson: 25.2 The three folders

Use the library in an app Jenkinsfile. Apps need to use the shared code in one line, and pin a version so changes don't surprise them.
Revision card 3 of 6: Use the library in an app Jenkinsfile · Download PNG · Open card page

Lesson: 25.3 @Library in the app Jenkinsfile

Credentials and withCredentials. Builds need passwords and tokens, but they must not appear in code or logs.
Revision card 4 of 6: Credentials and withCredentials · Download PNG · Open card page

Lesson: 25.4 Credentials and withCredentials

Parameters again, including password. Users pick values at start, but typed secrets are risky.
Revision card 5 of 6: Parameters again, including password · Download PNG · Open card page

Lesson: 25.5 Parameters again, including password

dev, test, staging, prod. Shipping straight to users is risky. Each step catches different problems.
Revision card 6 of 6: dev, test, staging, prod · Download PNG · Open card page

Lesson: 25.6 DEV, TEST, STAGING, PROD

Interview cards

What is a Jenkins shared library and why use it? A Git repo of reusable pipeline code. Many Jenkinsfiles call it, so a fix is made in one place.
Interview card 1 of 6: What is a Jenkins shared library and why use it? · Download PNG · Open card page

Lesson: 25.1 Why a library

What is the vars folder in a shared library? Each file in vars/ becomes a global step. vars/buildNode.groovy with def call() is used as buildNode().
Interview card 2 of 6: What is the vars folder in a shared library? · Download PNG · Open card page

Lesson: 25.2 The three folders

Why pin a shared library version? So a library change does not break every pipeline at once. @Library('lib@v1') uses tag v1.
Interview card 3 of 6: Why pin a shared library version? · Download PNG · Open card page

Lesson: 25.3 @Library in the app Jenkinsfile

How do you push to Docker Hub from Jenkins without showing the password? Use withCredentials with a username-password credential, and --password-stdin.
Interview card 4 of 6: How do you push to Docker Hub from Jenkins without showing the password? · Download PNG · Open card page

Lesson: 25.4 Credentials and withCredentials

Should you use a password parameter? Rarely. It hides the value, but a person types it each time. Prefer stored credentials.
Interview card 5 of 6: Should you use a password parameter? · Download PNG · Open card page

Lesson: 25.5 Parameters again, including password

How do you move one build through dev, test, staging and prod? Build once, then deploy the same artifact to each environment, with checks and an approval before prod.
Interview card 6 of 6: How do you move one build through dev, test, staging and prod? · Download PNG · Open card page

Lesson: 25.6 DEV, TEST, STAGING, PROD

Comparison cards

Shared library vs copied Jenkinsfile code. Library: one repo of shared steps.Copy: same code pasted in each repo.
Comparison card 1 of 3: Shared library vs copied Jenkinsfile code · Download PNG · Open card page

Lesson: 25.1 Why a library

Password parameter vs stored credential. Password parameter: a person types the secret at each build.Credential: stored once, used by ID.
Comparison card 2 of 3: Password parameter vs stored credential · Download PNG · Open card page

Lesson: 25.5 Parameters again, including password

Staging vs production. Staging: a copy of prod for final checks.Production: what real users use.
Comparison card 3 of 3: Staging vs production · Download PNG · Open card page

Lesson: 25.6 DEV, TEST, STAGING, PROD