Customer Portal

Get Involved. Join the Conversation.

Topic

    Nital Joshi
    Jenkin automation tool with CP
    Topic posted July 5, 2017 by Nital JoshiRed Ribbon: 250+ Points 
    357 Views, 19 Comments
    Title:
    Jenkin automation tool with CP
    Content:

    I am implementing Jenkin automation tool to build CP batch to be deployed automatically on Production. how we can deploy to production without going through customer portal UI? Any idea how to use Jenkin to generate build with last revision difference only ? It should not checkout whole project. It should only include those files which are changed from last build revision. Thanks in advance !

     

    Thanks,

    Nital Joshi

    Comment

    • Chris Rogers

      I didn't have any problems mounting using davfs

      in /etc/fstab I have something along the lines of

      https://interface.custhelp.com/dav /mnt/jenkins/interface davfs rw,user,noauto 0 0
      

      Then have the username / password stored in ~/.davfs/secrets

      http://ajclarkson.co.uk/blog/auto-mount-webdav-raspberry-pi/ is a pretty good tutorial.

       

      I have used Jenkins pipeline jobs to pretty much script the uploading of files. It is in a Jenkinsfile that we store in git as well, so can track changes to the script.

      I have a Job for each interface, using parameters in the job to tell the script where to upload the files to. You could do the same, and have a trigger job in jenkins which fires off the rest, or just have one job to upload to all in one go.

    • Pushkar Bisht

      Hi Chris,

      I was trying the same. I got stuck while installing "davfs2" from genkin job. I am using following pipeline:

      pipeline {
      agent { label 'predixci-jdk-1.8-ubuntu' }
      options { timestamps() }
       
      stages{
       
      stage('Deploy Env Setup'){
              
          steps{
              script{
          sh '''
          apt-get -y install davfs2
          '''
          }
          }
          }
      }
      post {
      success {
      echo "Sending completion email"          
      deleteDir()
      }
      failure {
      echo "Execution failure"   
      deleteDir()
      }
      } // post section closure
      } // pipeline closure 
       
      So when i ran this script, it ran for some lines and then gets stucked at a place. From there its showing me a loading indicator for a very long time. Following is the output i got before stuck.
       
      
       
      
      15:50:37 [dav1] Running shell script 15:50:37 + apt-get -y install davfs2 15:50:39 Reading package lists... 15:50:39 Building dependency tree... 15:50:39 Reading state information... 15:50:39 The following extra packages will be installed: 15:50:39  libneon27 15:50:39 The following NEW packages will be installed: 15:50:39  davfs2 libneon27 15:50:41 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. 15:50:41 Need to get 312 kB of archives. 15:50:41 After this operation, 698 kB of additional disk space will be used. 15:50:41 Get:1 http://deb.debian.org/debian/ jessie/main libneon27 amd64 0.30.1-1 [162 kB] 15:50:41 Get:2 http://deb.debian.org/debian/ jessie/main davfs2 amd64 1.5.2-1 [150 kB] 15:50:41 debconf: delaying package configuration, since apt-utils is not installed 15:50:41 Fetched 312 kB in 0s (559 kB/s) 15:50:41 Selecting previously unselected package libneon27. 15:50:41 (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 31481 files and directories currently installed.) 15:50:41 Preparing to unpack .../libneon27_0.30.1-1_amd64.deb ... 15:50:41 Unpacking libneon27 (0.30.1-1) ... 15:50:41 Selecting previously unselected package davfs2. 15:50:41 Preparing to unpack .../davfs2_1.5.2-1_amd64.deb ... 15:50:41 Unpacking davfs2 (1.5.2-1) ... 15:50:42 Setting up libneon27 (0.30.1-1) ... 15:50:42 Setting up davfs2 (1.5.2-1) ... 15:50:42 debconf: unable to initialize frontend: Dialog 15:50:42 debconf: (TERM is not set, so the dialog frontend is not usable.) 15:50:42 debconf: falling back to frontend: Readline 15:50:42 Configuring davfs2 15:50:42 ------------------ 15:50:42  15:50:42 The file /sbin/mount.davfs must have the SUID bit set if you want to allow 15:50:42 unprivileged (non-root) users to mount WebDAV resources. 15:50:42  15:50:42 If you do not choose this option, only root will be allowed to mount WebDAV 15:50:42 resources. This can later be changed by running 'dpkg-reconfigure davfs2'. 15:50:42  
      
       
      Can you please suggest me anything.
       
      Thanks,
      Pushkar

       

    • Chris Rogers

      Have you tried installing davfs2 manually on the server. Seems like it might have worked in your pipeline, but is just showing some info about how you can reconfigure it.

      Clearly you don't have to install davfs2 every time you run the job, unless very weird things are happening on your jenkins server??!

    • Kyle Stadler

      It's a hidden shortcut so I don't know how well-supported this is or if this is just an artifact of early CP versions that has remained in the code for a long time or what, but as of version 18B if you hit this URL for an interface:

      /ci/admin/deploy/stageAndPromote (or just /ci/admin/deploy which redirects there)

      It will go ahead and copy all changes from development into staging and then promote staging to production, all in a single action.  Don't use this if you need to selectively stage anything from development, but if you need to move everything into production it can be a timesaver.