Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
src
README.md
pom.xml

README.md

Ticket Monster Backend V1

This backend module contains the monolith Ticket Monster service without the UI. Use an external UI to connect to the REST API that this service exposes.

Prerequisites

  • Requires access to a PCF Cluster
  • Make sure you have Cloud Foundry CLI installed
  • You need Maven to build the monolith
  • You need Docker to create a Docker image
  • Sign In to your DockerHub Account

Instructions

0. Clone the repository and change directory

$ cd backend-v1

1. Make sure to have a mysql Cloud Foundry service instance described here

If you don't have a ticketMonster-mysql service, create one using:

$ cf create-service p-mysql 100mb ticketMonster-mysql

2. Build the latest version of the backend-v1 as Docker image

$ mvn clean install -P mysql fabric8:build -D docker.image.name=<your dockerhub account>/backend:v1

3. Move to Dockerfile and push Docker image to DockerHub

$ cd .\target\docker\<your dockerhub account>\backend\v1\build\
$ docker push <your dockerhub account>/backend:v1

4. Push the application to Cloud Foundry by refering to the container image on DockerHub

cf push backend-v1 -o <your dockerhub account>/backend:v1

5. Bind the mysql service instance to the application

$ cf bind-service backend-v1 ticketMonster-mysql

6. Get binding information (jdbcUrl, name and password) and set environment variables: database connection-url, user-name, and password to these values

$ cf env backend-v1
$ cf set-env backend-v1 CONNECTION-URL jdbc:mysql://***
$ cf set-env backend-v1 USER-NAME ***
$ cf set-env backend-v1 PASSWORD ***

7. Restage application to ensure your environment variable changes take effect

$ cf restage backend-v1