Skip to content

Latest commit

 

History

History
66 lines (43 loc) · 1.53 KB

1_CONFIGURE_JENKINS.md

File metadata and controls

66 lines (43 loc) · 1.53 KB

Getting Started: Jenkins

  1. Run the virtual machine (it'll take some minutes):

    vagrant up jenkins
  2. Copy jenkins' admin password:

    vagrant ssh jenkins -c "sudo cat /var/lib/jenkins/secrets/initialAdminPassword" | clipcopy
  3. Configure Jenkins:

    Open http://localhost:9090/.

    At this point jenkins will ask you for the Administrator password, paste it, and install suggested plugins.

    Then, you have to create the First Admin User.

  4. Install Plugins:

    Go to http://localhost:9090/manage/pluginManager/available.

    Search for Docker and select Docker and Docker Pipeline

    Search for Copy Artifact and select Copy Artifact.

    Click on Install.

    Additional, on the installation page, check the option Restart Jenkins when installation is complete and no jobs are running, and wait until it finishes.

  5. Create a test pipeline:

    On the Jenkins' landing page http://localhost:9090/, click on New Item and put Test Docker as name.

    Then select Pipeline and click on OK.

    Scroll down onto Script, and paste next code:

    pipeline {
        agent {
            docker { image 'eclipse-temurin:17-jdk' }
        }
    
        stages {
            stage('Test') {
                steps {
                    echo 'Hello World!'
                    sh 'java --version'
                }
            }
        }
    }

    Then click on Save.

    Finally, click on Build Now.

Next >