This document outlines information and steps to run, test and deploy this project
https://github.com/slalom/spring-boot-pcf.git
-
IDE of choice
-
Maven
-
Spring Tool Suite 4
-
Pivotal Cloud Foundry
-
Mongodb (pivotal service)
-
TBD - Concourse
-
TBD - Spinnaker
-
create account
-
verify email
-
Click on Pivotal Web Services
-
Claim your Trial, and verify via sms
-
Create your org name
-
Install ths cf cli
- brew install cloudfoundry/tap/cf-cli
-
Try the following command to test that the cf CLI works:
- cf help
-
Login to cf
- cf login -a https://api.run.pivotal.io
- Cd into the application directory
- Mvn package
- ‘mvn spring-boot:run
- Or if you have spring boot dashboard installed, use the ui
- https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-spring-boot-dashboard
- Mvn package
- *cf push app-name -p target/app-name.jar
-
Login to https://console.run.pivotal.io/
-
Click on your app name
-
In the left tab click on marketplace and search for mongodb
-
Select mlab mongo-db-as-a-service
-
Select free plan
-
In the next form, choose and instance name, add to space and bind to app
-
Go back home and you should see services(1) in the left hand nav
-
Click on services and click on the name of the mongodb service
-
In the top right click “manage”
-
Click on the db
-
This will be your bd uri for application.properties
-
Select Users from the tab section below
-
Add a user with username and password
-
add credentials to application.properties file: spring.data.mongodb.uri=mongodb://:@
-
Check your db in the command line thus: mongo ds157857.mlab.com:57857/dbname -u username -p password
-
Change your mongo service name in manifest.yaml (manifest.yaml needs to be created at the root level) to your db name 1. --- applications:
- name: yourappname env: MONGO_SERVICE_NAME: "yourdbinstancename" (find in PCF web services)
*OR via the cf cli
-
$ cf create-service mlab sandbox mydb
-
$ cf bind-service my-app mydb Binding service mydb to my-app in org my-org / space test as [email protected]... OK TIP: Use 'cf push' to ensure your env variable changes take effect
-
$ cf restart my-app
- Front end is TBD, probably will be react
- PCF app manifests: https://docs.cloudfoundry.org/devguide/deploy-apps/manifest-attributes.html
- Concourse: https://www.youtube.com/watch?v=1RRZHPlTkXs&feature=youtu.be&t=3586
- Spinnaker: https://www.slideshare.net/Pivotal/making-microservices-smarter-with-istio-envoy-and-pivotal-service-mesh?next_slideshow=1
- Official Apache Maven documentation
- Spring Boot DevTools
- Spring Data Reactive MongoDB *Spring Boot Guide
- Install concourse - $ wget https://concourse-ci.org/docker-compose.yml
- $ docker-compose up -d (Make sure you don’t have a port conflict. Concourse runs on 8080 by default.)
- Download fly cli tools (https://medium.com/concourse-ci/getting-started-with-concourse-ci-on-macos-fb3a49a8e6b4)
- brew cask install fly
- Set up pipeline (see resource below, or view pipeline in sourcecode)
- fly -t example set-pipeline --pipeline my-pipeline --config pipeline.yml
- Make sure your creds aren't in the pipeline.yml
- fly -t hello set-pipeline --pipeline my-pipeline --config pipeline.yml -l pipeline-secrets.yml
- https://medium.com/concourse-ci/getting-started-with-concourse-ci-on-macos-fb3a49a8e6b4
- https://github.com/eddytnk/deploy-springboot-app-using-concourse-ci/blob/master/mvnw
- https://github.com/eddytnk/deploy-springboot-app-using-concourse-ci/blob/master/ci/pipeline.yml
- https://github.com/patrickcrocker/concourse-maven-cf-simple