Skip to content

bob-crutchley/spring-installer-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-installer-example

script to install jenkins and the spring-boot-hello-world server

setup

clone the project

git clone https://github.com/bob-crutchley/spring-installer-example
cd spring-installer-example

run the install scripts

this will install jenkins and the spring service (you will sudo access for this)

bash install.sh

follow the jenkins setup

jenkins can be accessed from port 8080, follow the guided setup of jenkins, selecting the default options jenkins setup

create a job in jenkins

on the jenkins home page select create new jobs or New Item and create a freestyle project. jenkins job setup

set the GitHub repository and branch

configure the jenkins job to use the spring-boot-hello-world project on the port-9000 branch jenkins source code management

set the job to build on changes to the branch

configure poll SCM so that jenkins checks for a change on the port-9000 branch every 1 minute jenkins poll scm

configure the build script

under the build section click Add build step > Execute shell and enter the script below

# create the application jar file
mvn clean package
# copy the jar file to the spring user home
sudo cp target/hello-world-0.0.1-SNAPSHOT.jar /home/spring/app.jar
# make sure that the spring user owns the jar file
sudo chown spring:spring /home/spring/app.jar
# restart the spring service
sudo systemctl restart spring

it should look something like this in the jenkins job configuration jenkins execute shell

save the job configuration

click the Save button at the bottom of the screen
whenever a change is made to the port-9000 branch now the jenkins job will execute

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages