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

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/
    

  7. Setup security
    Manage Jenkins -> Configure Global Security, check Enable security
    EnableSecurity
    Choose Jenkins’ own user database, check Allow users to sign up (only once)
    SecurityRealm
    Choose Anyone can do anything (only once)
    AnyOneCanDoAnything
  8. Go to home page and sign up for the first time user (will be an administrator)
  9. Add credential to admin
    Manage Jenkins -> Configure Global Security, at the Authorization section check Matrix-based security.
    Add the newly registered user and configure as admin (check all)
    Admin
    From now if there is a new user, we must set their access level, so they can use Jenkins.
  10. Add Jenkins Plugins
    Manage Jenkins -> Manage Plugins, search in tab Available
    Install this plugin:
    git (GIT plugin) https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin
    git-parameter (Git Parameter Plug-In) https://wiki.jenkins-ci.org/display/JENKINS/Git+Parameter+Plugin
    publish-over-ssh (Publish Over SSH) https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+SSH+Plugin
    Play!Framework plugin, go to tab advanced, at Upload Plugin section upload the plugin (download at https://github.com/rafaelrezend/rafaelrezend.github.io/raw/7e3a98bad985b055e2bd7cc7d97e4dcb3b9b9cb4/images/play-plugin/play-plugin.hpi )
    InstalledPlugin
  11. Restart Jenkins server
    sudo service jenkins restart
    

 

Categories: Jenkins, Play! Framework
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment