Skip to content

Instantly share code, notes, and snippets.

@h-parekh
Last active July 12, 2021 19:21
Show Gist options
  • Save h-parekh/bff04b97bdd8d2428771f9238d7a1e46 to your computer and use it in GitHub Desktop.
Save h-parekh/bff04b97bdd8d2428771f9238d7a1e46 to your computer and use it in GitHub Desktop.
Setup Jenkins (LTS) using Minishift and Docker Hub

Assumptions

  • You are using MacOS 10 or above
  • Have Homebrew installed
  • You need a dev-only setup

Commands

Step 1: Install Minishift and a VirtualBox hypervisor

brew cask install minishift

brew cask install virtualbox

Step 2: Start minishift with virtual box

minishift start --vm-driver virtualbox

Wait for a message like:

The server is accessible via web console at: https://x.x.x.x:8443

Step 3: configure shell to add oc binary to your PATH

eval $(minishift oc-env)

Step 4: Check if oc works

oc version

Step 5: Login as admin

oc login -u admin -p admin

Step 6: Install jenkins using a docker hub image

Use '--docker-image jenkinsci/blueocean:latest' if you want to include BlueOcean

oc new-app --docker-image jenkins/jenkins:lts --name=my-jenkins

Step 7: Create a route (Unsecured)

oc expose svc/my-jenkins --name=my-jenkins-route

Step 8: Find your local Jenkins URL in 'Requested Host'

oc describe routes

Step 9: Get the security token for Jenkins installation

oc logs --version=1 dc/my-jenkins | grep 'Please use the following security token to proceed to installation' -A 5

Once you open the URL from step 7, you will need to enter this security token to proceed with installation

Related references:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment