Skip to content

A jenkins2 pipeline playground to setup local CI environment with vagrant & ansible.

Notifications You must be signed in to change notification settings

battini90/jenkins2-pipeline-lab

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jenkins2-pipeline-lab

Prerequisites

  • vagrant
  • ansible 2.0.2 (! only works with this version)

Setup your local environment

1. Create & provision vagrant boxes

 vagrant up

You need to choose your network for bridging. Mostly option 1)

Configure ssh for your vagrant boxes

./scripts/configure-ssh.sh

Let's try it

Links & References

Jenkinsfile

    def gitCommit
    stage('Checkout')
    node {
        // Get some code from a GitHub repository
        git url: 'https://github.com/Endron/dnd5-char-viewer.git'
        sh 'git rev-parse HEAD > git.id'
        gitCommit = readFile('git.id')
    }

    stage('Build') 
    node {
        def dockerTag = "localhost:5000/dndviewer:${gitCommit}"
        
        sh "./gradlew clean build"
        sh "docker build . --tag ${dockerTag}"
        sh "docker push ${dockerTag}"
    }

    //checkpoint 'Completed CI'

    stage ('Deploy') 
    node {
        sshagent(['jenkins']) {
            sh 'ssh -o StrictHostKeyChecking=no -l ubuntu 192.168.42.11 uname -a'
        }
    }

About

A jenkins2 pipeline playground to setup local CI environment with vagrant & ansible.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Groovy 56.3%
  • Ruby 22.9%
  • Shell 19.0%
  • Python 1.8%