Skip to content

developerops85/Jenkins-ruby

Repository files navigation

Sinatra WebMF

Running the Service

Locally with Rack

With a Ruby environment installed and bundler gem (gem install bundler), you can run the application locally with:

bundle install   # install Sinatra library
rackup &         # start server via Rack
# manually test
curl -i localhost:3000/
curl -i localhost:3000/hello/Simon

Using Docker-Compose

docker-compose up -d  # start up container
# set server IP address
[ -z ${DOCKER_MACHINE_NAME} ] || WEBSERVER=$(docker-machine ip ${DOCKER_MACHINE_NAME})
WEBSERVER=${WEBSERVER:-localhost}
# manually test
curl -i ${WEBSERVER}:3000/
curl -i ${WEBSERVER}:3000/hello/Simon

Using Docker in Vagrant/Virtualbox

vagrant up  # start up virtualbox w/ docker container
# manually test
curl -i localhost:3000/
curl -i localhost:3000/hello/Simon

Testing

Locally

There are basic unit tests provided, to run them simply run:

rake

Continious Integration

In a CI system, for a test stage, you can run:

rake ci:all

A Jenkinsfile using DSL pipeline is provided to demonstrate this solution.

Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors