[CD/CI] - Jenkins, Cloud, ....

December 18, 2023 |

  

Jenkins

I. Installation


II. Config and deploy the application via tomcat
Ref: 
https://www.middlewareinventory.com/blog/jenkins-tomcat-deploy-deploying-application-tomcat-using-jenkins/

Step 1: Install Tomcat in your server (CENT OS)
Reference: view here

Step 2: Tomcat Configuration
Open and config user:

<user username="tomcatmanager" password="password" roles="manager-gui"/>
<
user username="deployer" password="password" roles="manager-script"/>

"Tomcatmanager" is used to manage apps in Tomcat GUI.
"deployer" is used for deploying your app via Jenkins.

Step 3: Config your GIT or SVN and Maven installed
In Jenkins GUI, Manage Jenkins > Global Tool Configuration 



Step 4: Install Deploy to Container Plugin
Manager Jenkins > Manag Plugin > Available > Deploy to Container Plugin

Step 5: Create and Configure a Maven Job with Source Code Management (Git or SVN)

New Item > Maven Project > Source code management 


Repository URL: <git_url>
Create and provide Credentials include user name/password.

You should separate many users for git. 

Step 6: Configure the Post-build action and Specify the Tomcat server details
Item > Build > Post Steps > Deploy war/ear to container.



Step 6: Build Jenkins Jobs
Item > Build Now > Check Result


My project screenshot:

Config SVN or GIT:

Build steps: Execute command and copy app release to another place




Another one , I leave default setting

III. Config and deploy the application via tomcat (Jenkins + Spring Boot app + Spring MVC + Gradle + Tomcat 10)

1. Config Jobs
General


Git:



Gradle:
Before: Setup Gradle Global: Dashboard > Manage Jenkins > Tools





If Gradle Build in sub folder project, you must config Root Build Script. If so, Jenkins doesn't build.gradle

Deploy to Tomcat 10:



Jenkins tip

1. Build steps


* Execute Windows batch command => for Windows. You must set cmd.exe in shell execute:
Dashboard > Configure System : Set Shell



* Execute shell => for Linux

Problems:



Solution: Use default maven setting instead of your setting


Run Jenkins Agent in Windows:
Step1. Run the command below to download agent.jar:
$ curl -sO http://localhost:8080/jnlpJars/agent.jar

Step 2. Run Agent slave in windows:
//Run default Java
$ java" -jar agent.jar -jnlpUrl http://localhost:8080/computer/Window%20Slave/jenkins-agent.jnlp -secret 234b78f48ecb**********663d38 -workDir "D:\Jenkins\app_release"

// Run Specific Java Version
$"C:\Program Files\Java\jdk-11.0.3\bin\java" -jar agent.jar -jnlpUrl http://localhost:8080/computer/Window%20Slave/jenkins-agent.jnlp -secret 234b78f48********f92383d83407663d38 -workDir "D:\Jenkins\app_release"

You can see the guide and secret key here:









Check status
Agent Status in Windows




Cloud Base







is updating...




Read more…

[Java] - ORM on Java

November 02, 2023 |


Read more…

Android Studio A->Z

October 05, 2023 |

 



1 Android Simulation graphic problems
Problems:
- Device display problems
- Device run slow and crash.

Solution:
Change Emulate graphic from Automatic to another graphic.
-  Devices > Click ... icon > Show on Disk > config.ini and edit:
hw.gpu.enabled=yes
hw.gpu.mode=software


Read more…

[Wordpress] - Install wordpress on CentOS

April 04, 2023 |

 



How to install WordPress in CentOS and config NO-IP for your website

Read more…

Firebase

February 17, 2023 |

 

1. How to install firebase CLI in windows

Ref: https://firebase.google.com/docs/hosting/quickstart

Windows:
$ npm -g install firebase-tools
$ firebase --version
$ firebase login
$ firebase use --add (select your project id)

2. Run Firebase project in local
$ firebase serve --only hosting // run local only
$ firebase serve --host 0.0.0.0 // allow access any source

Read more…