CI CD Pipeline - studiofu/brain GitHub Wiki

Pipeline in Jenkins

Basic Setup - Manage Jenkins after login to the administrative page

  • Configure System
    • Publish over SSH
      • add SSH Severs
  • Global Tool Configuration
    • JDK installation
    • Ant installation
    • Maven installation
  • Plugin Manager
    • install the required plugin
    • need to install the ssh, maven integration, Publish Over SSH, Deploy WebLogic, WildFly Deployer, etc... , plugins

Jenkins Project Setup

  • Configuration, either from New Item or Existing Items
  • General
    • Project Name
    • set discard old builds
  • Source Code Management
    • add the svn repository
  • Build Triggers
    • all unchecked
  • Build Environment
    • Set build environment, such as ant etc..
  • Build
    • Set build, such as ant
  • Post-build Actions
    • SSH Publishers
      • set the transfer set
        • source files, such as target\application.tar
        • remove prefix, target\
        • remote directory
        • exec command (for deployment)

Execute command example (from eSmart Project) for deploying the application to websphere.

cd /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/xxx_target/
ls -al
rm -rf build
mkdir build

tar -xvf xxx.tar -C build

cd build
ls -al

/usr/IBM/WebSphere/AppServer/bin/stopServer.sh server1 -user xxx -password xxx

rm -rf /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war/WEB-INF
rm -rf /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war/common
rm -rf /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war/error
rm -rf /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war/menu
rm -rf /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war/resources
rm -rf /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war/index.jsp

cd /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/xxx_target/build

cp -r WEB-INF /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war/
cp -r common /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war/
cp -r error /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war/
cp -r menu /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war/
cp -r resources /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war/
cp -r index.jsp /usr/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/xxxNode01Cell/xxx_war.ear/xxx.war

/usr/IBM/WebSphere/AppServer/bin/startServer.sh server1

Required Plugin

skip-certificate-check

This is a plugin that makes JVM bypass all the HTTPS certificate checks. Convenient if you deal with self-signed certificates and so on. Use with caution.

Resources

jenkins自動部署到tomcat/weblogic

https://www.itread01.com/content/1548659193.html

Jenkins——应用篇——插件使用——Publish over SSH

https://blog.csdn.net/houyefeng/article/details/51027885

Jenkins and Ansible 30 Days

https://ithelp.ithome.com.tw/articles/10193903

Setup CI CD Pipeline

https://dzone.com/articles/learn-how-to-setup-a-cicd-pipeline-from-scratch

https://github.com/prasanjit-/devops_pipeline_demo

Jenkins Simple Job By Using Maven

https://medium.com/@samtsai15/udemy%E7%AD%86%E8%A8%98-%E6%8C%81%E7%BA%8C%E6%95%B4%E5%90%88-ci-%E5%B7%A5%E5%85%B7-jenkins-6-%E8%87%AA%E5%8B%95%E5%8C%96%E7%B7%A8%E8%AD%AF-maven-71bfde504ecb