Giter Club home page Giter Club logo

jenkins's Introduction

Jenkins Lab 1

1- Install jenkins with docker image

docker run -d -p 8083:8080 jenkins/jenkins:lts 
  • To get Password 2 ways
docker logs <container-ID> 
  • OR
docker exec -it <container-SHA-1> bash 
cat <password-path>

Screenshot from 2023-02-03 22-58-19


2- Install role based authorization plugin

  • In manage Plugins Install the plugin then restart jenkins

Screenshot from 2023-02-03 23-02-20

Screenshot from 2023-02-03 23-26-05


2- Create new user

Screenshot from 2023-02-03 23-14-09


3- Create read role and assign it to the new user

Screenshot from 2023-02-03 23-27-52

Screenshot from 2023-02-04 00-00-51

Screenshot from 2023-02-04 00-01-07


4- Create free style pipeline and link it to private git repo(inside it create directory and create file with "hello world")

  • Provide Repo URL then porivde credentials as Usrname and Password but use Access Token

Screenshot from 2023-02-04 00-13-14

Screenshot from 2023-02-04 00-15-26

Screenshot from 2023-02-04 00-35-36

Screenshot from 2023-02-04 00-35-48


5- Create declarative in jenkins GUI pipeline for your own repo to do "ls"

  • I used 2 ways to do pass Credentials
  • 1- Passed credentials ID to the script this ID is found in var/jenkins_home/credentials.xml
  • 2- You can choose option from GUI to pull from SCM and provide credentials there

Screenshot from 2023-02-04 00-56-08


6- Create scripted in jenkins GUI pipeline for your own repo to do "ls"

  • Same as declartive way with different syntax

Screenshot from 2023-02-04 01-01-10

Screenshot from 2023-02-04 01-01-36


7- Create the same with jenkinsfile in your branches as multibranch pipeline

  • Each Branch has a Jenkinsfile
  • The pipeline checks every branch for this files then run pipeline for each branch

Screenshot from 2023-02-04 01-16-40

Screenshot from 2023-02-04 01-21-39

Screenshot from 2023-02-04 01-22-12


Thank You !

jenkins's People

Contributors

alii2121 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.