/spring-attack

This is an example app for my session at the SpringOne2Gx.

Primary LanguageCSS

spring-attack

This is an example app for my session at the SpringOne2Gx. It demonstrates combining SendGrid and Cloudfoundry.

Demo

Show the app code. Run it with gradle jettyRunWar locally.

Show that you then do gem install cf but just in a slide.

Go through the following steps live.

cf target api.run.pivotal.io
cf login
gradle assemble
cf push --path build/libs/spring-attack.war

Then show the live running app. Then add SendGrid.

cf create-service sendgrid
cf bind-service

Next, show how you can see the VCAP_Environment variables.

cf restart spring-attack
cf files spring-attack logs/env.log

Note the username and password in the VCAP_SERVICES and then lets set those as environment variables.

cf set-env spring-attack SENDGRID_USERNAME username
cf set-env spring-attack SENDGRID_PASSWORD password

Note that they are in there.

cf env spring-attack

Production

Deploy to Cloud Foundry

gem install cf
cf target api.run.pivotal.io
cf login
gradle assemble
cf push --path build/libs/spring-attack.war

Development

Usage

  1. Set the SENDGRID_USERNAME and SENDGRID_PASSWORD environment variables.
export SENDGRID_USERNAME=your_username
export SENDGRID_PASSWORD=your_password
  1. Then build and serve the war file.
gradle jettyRunWar
  1. Visit http://localhost:8080.