This is a snippet that will create a new user in jenkins and if security has been disabled , it will enable it :)
import jenkins.model.*
import hudson.security.*
def instance = Jenkins.getInstance()
def hudsonRealm = new HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount("MyUSERNAME","MyPASSWORD")
instance.setSecurityRealm(hudsonRealm)
| # Navigated to /etc/apt/sources.list.d/ | |
| cd /etc/apt/sources.list.d/ | |
| # Edited google.list by invoking | |
| eg: sudo nano google.list | |
| # Commented out the source with a '#' | |
| # Save and run | |
| sudo apt-get update |
| variable regions_as_objects { | |
| type = list(object({ | |
| zone = string | |
| region = string | |
| })) | |
| default = [ | |
| { | |
| zone = "us-east1-c" | |
| region = "us-east1" |
A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.
Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.