Configuration of Continuous Integration Server:
1. Create one Parent Folder “cIserver” in a local drive / directory
2. And then Create ant , home, java, maven, tomcat folder on it.
3. Now download the latest version of the above software and put it in appropriate folder.
4. In tomcat’s webapp folder , place jenkins war file to deploy it on your server.
5. Now create two bat file to start and stop the server. We have to set all enviornmental variable in “start.bat file”
6. “start.bat” will looks like –
setlocal rem ---------------- JAVA_HOME ------------------------- set "CURRENT_DIR=%cd%" if not "%JAVA_HOME%" == "" goto gotJAVA_HOME set "JAVA_HOME=%cd%\java\jdk1.7.0_60" cd "%CURRENT_DIR%" :gotJAVA_HOME echo "Our JAVA_HOME is %JAVA_HOME%" rem ---------------- JAVA_HOME ------------------------- rem ---------------- ANT_HOME ------------------------- set "CURRENT_DIR=%cd%" if not "%ANT_HOME%" == "" goto gotANT_HOME set "ANT_HOME=%cd%\ant\apache-ant-1.9.3" set "PATH=%PATH%;%ANT_HOME%\bin" cd "%CURRENT_DIR%" :gotANT_HOME echo "Our ANT_HOME is %ANT_HOME%" rem ---------------- ANT_HOME ------------------------- rem ---------------- JENKINS_HOME ------------------------- set "CURRENT_DIR=%cd%" if not "%JENKINS_HOME%" == "" goto gotJENKINS_HOME set "JENKINS_HOME=%cd%\home" cd "%CURRENT_DIR%" :gotJENKINS_HOME echo "Our JENKINS_HOME is %JENKINS_HOME%" rem ---------------- JENKINS_HOME ------------------------- rem ---------------- MAVEN_HOME ------------------------- set "CURRENT_DIR=%cd%" if not "%MAVEN_HOME%" == "" goto gotMAVEN_HOME set "MAVEN_HOME=%cd%\maven\apache-maven-3.2.1" set "PATH=%PATH%;%MAVEN_HOME%\bin" cd "%CURRENT_DIR%" :gotMAVEN_HOME echo "Our MAVEN_HOME is %MAVEN_HOME%" rem ---------------- MAVEN_HOME ------------------------- cd tomcat\bin\ startup.bat
In last line of bat file it is navigating to tomcat\bin folder to start tomcat’s “startup.bat” file
7. And “stop.bat” looks like –
setlocal rem ---------------- JAVA_HOME ------------------------- set "CURRENT_DIR=%cd%" if not "%JAVA_HOME%" == "" goto gotJAVA_HOME set "JAVA_HOME=%cd%\java\jdk1.7.0_60" cd "%CURRENT_DIR%" :gotJAVA_HOME echo "Our JAVA_HOME is %JAVA_HOME%" rem ---------------- JAVA_HOME ------------------------- rem ---------------- ANT_HOME ------------------------- set "CURRENT_DIR=%cd%" if not "%ANT_HOME%" == "" goto gotANT_HOME set "ANT_HOME=%cd%\ant\apache-ant-1.9.3" cd "%CURRENT_DIR%" :gotANT_HOME echo "Our ANT_HOME is %ANT_HOME%" rem ---------------- ANT_HOME ------------------------- cd tomcat\bin\ shutdown.bat
In last line of bat file it is navigating to tomcat\bin folder to start tomcat’s “shutdown.bat” file
8. To change tomcat’s default 8080 port , navigate to “cIserver\tomcat\conf” path and open “server.xml” and search for “Connector” node . If you want to use 1010 port for tomcat then replace it as –
9. To add local maven repository we need to create (say for example) “repo” folder on maven and path looks like “cIserver\maven\repo”.
10. Now navigate to conf folder “cIserver\maven\apache-maven-3.2.1\conf” and open “settings.xml” file.
11. Search for localRepository if it is commented then add
${M_REPO}
Else modify it .
12. Now in “start.bat” add one line in maven section – set “M_REPO=%cd%\maven\repo”
Enjoy the cI-Server.