Archive

Archive for the ‘Jenkins’ Category

Play! Framework – Deployment using Jenkins [Create Jobs]

August 31, 2015 1 comment

For the first time, you can click on create new jobs at home page. Or you can click New Item.
Choose Freestyle project and fill Item name, click Ok.

home_loginCreate job
Adding build parameter, I want to build specific branch, so I added git parameter

git parameterBuildParameter

In source code management I choose git then fill the config.

SourceCodeManagement

In section Build, choose Invoke Play! Framework. We can see this choice if we already installed the plugin. Fill the config. Play!Framework Installation choice will appear if we already configure Play! in Configure System.

build play

BuildStepPlay

The last step is configure Post-build Actions, I want to sent the artifact.

SentSSH

You must configure ssh server in Configure System.

Categories: Jenkins, Play! Framework

Play! Framework – Deployment using Jenkins [Installation and Configuration]

System requirement:

  • Java 7 or higher

 

  1. Jenkins installation
    sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat-stable/jenkins.repo
    sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
    sudo yum install jenkins
    
  2. Add jenkins to startup and then start
    sudo chkconfig jenkins on
    sudo service jenkins start
    
  3. Check if Jenkins had been running, go to http://your_ip:8080/

    home

  4. Configure JDK
    Go to Manage Jenkins – Configure System. In JDK section set java home.
    Set JDK
  5. Add ssh configuration (for git)
    cd /var/lib/jenkins/
    sudo mkdir .ssh
    sudo nano config
    

    Fill config file with

    Host repo your_git_ip
        HostName your_git_ip
        IdentityFile /var/lib/jenkins/.ssh/your_git_key
        User your_git_username
    

    Tes ssh config

    sudo su -s /bin/bash jenkins
    git ls-remote -h ssh://your_git_username@your_git_ip/your_git.git HEAD
    

    If result is are “too open”, change your_git_key permission to 600
    Change owner of config and key

    sudo chown jenkins:jenkins your_git_key
    sudo chown jenkins:jenkins config
    
  6. Get activator
    download activator

    wget http://downloads.typesafe.com/typesafe-activator/1.3.5/typesafe-activator-1.3.5-minimal.zip
    

    unzip to /opt and change owner jenkins:jenkins

    chown jenkins:jenkins -R activator-1.3.5-minimal/
    

    Read more…

Categories: Jenkins, Play! Framework