{"id":15805217,"url":"https://github.com/ddobrin/spring-light-demo","last_synced_at":"2025-08-30T12:38:24.581Z","repository":{"id":134175918,"uuid":"217719396","full_name":"ddobrin/spring-light-demo","owner":"ddobrin","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-29T16:13:20.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-06T02:05:38.151Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddobrin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-26T14:18:17.000Z","updated_at":"2021-03-03T18:26:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f27991f-d6df-4f3f-947f-f97d81721dc2","html_url":"https://github.com/ddobrin/spring-light-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ddobrin/spring-light-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddobrin%2Fspring-light-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddobrin%2Fspring-light-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddobrin%2Fspring-light-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddobrin%2Fspring-light-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddobrin","download_url":"https://codeload.github.com/ddobrin/spring-light-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddobrin%2Fspring-light-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272852281,"owners_count":25004053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-05T02:05:06.494Z","updated_at":"2025-08-30T12:38:24.546Z","avatar_url":"https://github.com/ddobrin.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Deploy Application to Pivotal Cloud Foundry \n\nThis document will guide a developer to deploying the demo app to the managed instance of PCF\n\n### Deploy a Spring microservice up and running on the Pivotal Platform.\nTo save time, we will be using Pivotal Web Services, an instance of Pivotal Platform hosted by Pivotal\nWe will use the cf CLI to perform all commands on apps deployed to the Pivotal Platform.\n\n#### To install the CloudFoundry CLI:\n```\nhttps://github.com/cloudfoundry/cli#installers-and-compressed-binaries\n```\n\nSelect the package manager for the MacOS\n```\nhttps://packages.cloudfoundry.org/stable?release=macosx64\u0026source=github\n```\n\nTo test that the CF CLI works, we can invoke the help command:\n```\ncf help\n```\n\n#### Deploy the sample app\n```\ngit clone git@github.com:ddobrin/docs.git\n\nLet's use the light-to-spring migration microservice\ncd docs\n\nTo build a clean copy, let's run:\n./mvnw clean install spring-boot:run\n```\n\n#### Check that the app is running and let's test the endpoints:\n```\ncurl http://localhost:8081/spring/pets\ncurl http://localhost:8081/light/pets\n\ncurl -H \"Authorization: Bearer eyJraWQiOiIxMDAiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJ1cm46Y29tOm5ldHdvcmtudDpvYXV0aDI6djEiLCJhdWQiOiJ1cm46Y29tLm5ldHdvcmtudCIsImV4cCI6MTc5NDg3MzA1MiwianRpIjoiSjFKdmR1bFFRMUF6cjhTNlJueHEwQSIsImlhdCI6MTQ3OTUxMzA1MiwibmJmIjoxNDc5NTEyOTMyLCJ2ZXJzaW9uIjoiMS4wIiwidXNlcl9pZCI6InN0ZXZlIiwidXNlcl90eXBlIjoiRU1QTE9ZRUUiLCJjbGllbnRfaWQiOiJmN2Q0MjM0OC1jNjQ3LTRlZmItYTUyZC00YzU3ODc0MjFlNzIiLCJzY29wZSI6WyJ3cml0ZTpwZXRzIiwicmVhZDpwZXRzIl19.gUcM-JxNBH7rtoRUlxmaK6P4xZdEOueEqIBNddAAx4SyWSy2sV7d7MjAog6k7bInXzV0PWOZZ-JdgTTSn6jTb4K3Je49BcGz1BRwzTslJIOwmvqyziF3lcg6aF5iWOTjmVEF0zXwMJtMc_IcF9FAA8iQi2s5l0DYgkMrjkQ3fBhWnopgfkzjbCuZU2mHDSQ6DJmomWpnE9hDxBp_lGjsQ73HWNNKN-XmBEzH-nz-K5-2wm_hiCq3d0BXm57VxuL7dxpnIwhOIMAYR04PvYHyz2S-Nu9dw6apenfyKe8-ydVt7KHnnWWmk1ErlFzCHmsDigJz0ku0QX59lM7xY5i4qA\" http://localhost:8081/spring/pets | json_pp\n```\n\n##### Handy Reference:\nhttp://cli.cloudfoundry.org/en-US/cf/\n\n#### 1. Log in to PWS:\n```cf login -a https://api.run.pivotal.io -u dan.dobrin@gmail.com```\n\nTarget a specific Org and Space\n```cf target -o dan.dobrin-org -s development```\n\n#### 2. List the apps running in the org:\n```cf apps```\n\nThere is no spring-light application, and we want to deploy it\n\n#### 3. Push the app to PWS\n```cf push```\n\ncheck with ```cf apps```\n\n#### 4. Check the logs:\n```\ncf logs spring-light --recent\ncf logs spring-light\n```\n\n#### 5. Check the health of the app:\nCheck the status of the app with: ```cf app spring-light```\n\n```\nShowing health and status for app spring-light in org dan.dobrin-org / space development as dan.dobrin@gmail.com...\n\nname:              spring-light\nrequested state:   started\nroutes:            spring-light-persistent-lynx.cfapps.io\nlast uploaded:     Sat 19 Oct 11:16:49 EDT 2019\nstack:             cflinuxfs3\nbuildpacks:        https://github.com/cloudfoundry/java-buildpack.git\n\ntype:           web\ninstances:      1/1\nmemory usage:   768M\n     state     since                  cpu    memory           disk           details\n#0   running   2019-10-19T15:17:05Z   0.1%   142.3M of 768M   129.2M of 1G\n```\n\n#### 6. Access the service\n```\ncurl https://spring-light-demo.cfapps.io/spring/pets\n\ncurl -H \"Authorization: Bearer eyJraWQiOiIxMDAiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJ1cm46Y29tOm5ldHdvcmtudDpvYXV0aDI6djEiLCJhdWQiOiJ1cm46Y29tLm5ldHdvcmtudCIsImV4cCI6MTc5NDg3MzA1MiwianRpIjoiSjFKdmR1bFFRMUF6cjhTNlJueHEwQSIsImlhdCI6MTQ3OTUxMzA1MiwibmJmIjoxNDc5NTEyOTMyLCJ2ZXJzaW9uIjoiMS4wIiwidXNlcl9pZCI6InN0ZXZlIiwidXNlcl90eXBlIjoiRU1QTE9ZRUUiLCJjbGllbnRfaWQiOiJmN2Q0MjM0OC1jNjQ3LTRlZmItYTUyZC00YzU3ODc0MjFlNzIiLCJzY29wZSI6WyJ3cml0ZTpwZXRzIiwicmVhZDpwZXRzIl19.gUcM-JxNBH7rtoRUlxmaK6P4xZdEOueEqIBNddAAx4SyWSy2sV7d7MjAog6k7bInXzV0PWOZZ-JdgTTSn6jTb4K3Je49BcGz1BRwzTslJIOwmvqyziF3lcg6aF5iWOTjmVEF0zXwMJtMc_IcF9FAA8iQi2s5l0DYgkMrjkQ3fBhWnopgfkzjbCuZU2mHDSQ6DJmomWpnE9hDxBp_lGjsQ73HWNNKN-XmBEzH-nz-K5-2wm_hiCq3d0BXm57VxuL7dxpnIwhOIMAYR04PvYHyz2S-Nu9dw6apenfyKe8-ydVt7KHnnWWmk1ErlFzCHmsDigJz0ku0QX59lM7xY5i4qA\" https://spring-light-demo.cfapps.io/spring/pets | json_pp\n\ncurl -H \"Authorization: Bearer eyJraWQiOiIxMDAiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJ1cm46Y29tOm5ldHdvcmtudDpvYXV0aDI6djEiLCJhdWQiOiJ1cm46Y29tLm5ldHdvcmtudCIsImV4cCI6MTc5NDg3MzA1MiwianRpIjoiSjFKdmR1bFFRMUF6cjhTNlJueHEwQSIsImlhdCI6MTQ3OTUxMzA1MiwibmJmIjoxNDc5NTEyOTMyLCJ2ZXJzaW9uIjoiMS4wIiwidXNlcl9pZCI6InN0ZXZlIiwidXNlcl90eXBlIjoiRU1QTE9ZRUUiLCJjbGllbnRfaWQiOiJmN2Q0MjM0OC1jNjQ3LTRlZmItYTUyZC00YzU3ODc0MjFlNzIiLCJzY29wZSI6WyJ3cml0ZTpwZXRzIiwicmVhZDpwZXRzIl19.gUcM-JxNBH7rtoRUlxmaK6P4xZdEOueEqIBNddAAx4SyWSy2sV7d7MjAog6k7bInXzV0PWOZZ-JdgTTSn6jTb4K3Je49BcGz1BRwzTslJIOwmvqyziF3lcg6aF5iWOTjmVEF0zXwMJtMc_IcF9FAA8iQi2s5l0DYgkMrjkQ3fBhWnopgfkzjbCuZU2mHDSQ6DJmomWpnE9hDxBp_lGjsQ73HWNNKN-XmBEzH-nz-K5-2wm_hiCq3d0BXm57VxuL7dxpnIwhOIMAYR04PvYHyz2S-Nu9dw6apenfyKe8-ydVt7KHnnWWmk1ErlFzCHmsDigJz0ku0QX59lM7xY5i4qA\" https://spring-light-demo.cfapps.io/light/pets | json_pp\n```\n\n#### 7. Pivotal Services\nPivotal Platform enables administrators to provide a variety of services on the platform that can easily be consumed by applications.\n\nCreate a DB service.\n**List all tiers available**\n```cf marketplace -s elephantsql```\n\nFor demo purposes, create a service  using the free plan (turtle)\n```cf create-service elephantsql turtle spring-light-db```\n\nBind the newly created service to the spring-ligtapp:\n```cf bind-service spring-light spring-light-db```\nOnce a service is bound to an app, environment variables are stored that allow the app to connect to the service after a push, restage, or restart command\n\nTip: Use 'cf restage spring-light' to ensure your env variable changes take effect\n```cf restage spring-light```\n\nCheck services and apps with:\n```\ncf services\ncf app spring-light\n```\n\nSee logs:\n```\ncf logs spring-light --recent\ncf logs spring-light\n```\n\n#### 8. Scale the application:\nIncreasing the available disk space or memory can improve overall app performance.\nSimilarly, running additional instances of an app can allow an app to handle increases in user load and concurrent requests. These adjustments are called scaling.\n\na. Scaling up available disk space or memory is called vertical scaling.\nb. Scaling your app horizontally adds or removes app instances. Adding more instances allows your application to handle increased traffic and demand.\n\nScale horizontally:\n```\ncf scale spring-light -i 2\n```\n\nScale memory up - vertically:\n```\ncf scale spring-light -m 1G\n```\n\nScale down disk space - vertically:\n```\ncf scale spring-light -k 512M\n```\n\n#### 9. Logout of the application\n\n```cf logout```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddobrin%2Fspring-light-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddobrin%2Fspring-light-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddobrin%2Fspring-light-demo/lists"}