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
- Publish over SSH
- 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)
- set the transfer set
- SSH Publishers
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