Skip to content

AlexVeprev/jenkins_demo_project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project to try Jenkins basics

Goal: repeat the same workflow as https://github.com/AlexVeprev/github_actions_demo_project

Status: done

General links

Instruction

  1. Configure 2-3 or more VMs:

    • For Jenkins controller (master).
    • For Jenkins agent(s).
    • For Docker server(s), i.e. Docker Cloud (item 4 below and option 3 in Jenkinsfile).
  2. Install Jenkins controller. E.g. using Docker. Follow this instruction, skip running docker:dind.

    Install additional plugins:

  3. Configure Jenkins agent(s):

    1. Install jre and docker.
    2. Create user "jenkins", allow him to use Docker.
    3. Create ssh-key pair (doesn't matter what host to use for this) and store public key in ~/.ssh/authorized_keys of Jenkins agent, add private key as Credential using Jenkins UI (Manage Credentials).
    4. Configure agent through Jenkins UI.
  4. As alternative (or addition) to statically configured Jenkins agent(s) from item 3 configure Docker Cloud using Jenkins Docker Plugin to create Jenkins agents dynamically:

    1. Install Docker to host and configure it.
    2. Prepare Docker images for dynamic runners, images should contain jre (see examples in jenkins/Dockerfile.agent_*).
    3. Configure Docker Cloud through Jenkins UI.
  5. Create project for GitHub; you'll need to add personal access token and some other secrets (see Jenkinsfile) to Credentials.

TODOs:

  • Prepare more precise Dockerfile for Jenkins controller with all the needed plugins.
  • Prepare more optimized (from size perspective) Docker images for builder and testers (including images with for dynamic agents).
  • Describe steps more precisely where makes sense.