{"id":24849341,"url":"https://github.com/bugbiteme/inventory-wildfly-swarm","last_synced_at":"2025-03-26T11:25:41.976Z","repository":{"id":71384628,"uuid":"134164507","full_name":"bugbiteme/inventory-wildfly-swarm","owner":"bugbiteme","description":"inventory-wildfly-swarm project needed for OpenShift microservice application","archived":false,"fork":false,"pushed_at":"2018-05-23T00:16:54.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T12:36:15.977Z","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/bugbiteme.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":"2018-05-20T15:52:28.000Z","updated_at":"2018-05-23T00:16:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9535633-8619-48a5-8ae2-b36a7adc5709","html_url":"https://github.com/bugbiteme/inventory-wildfly-swarm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugbiteme%2Finventory-wildfly-swarm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugbiteme%2Finventory-wildfly-swarm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugbiteme%2Finventory-wildfly-swarm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugbiteme%2Finventory-wildfly-swarm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugbiteme","download_url":"https://codeload.github.com/bugbiteme/inventory-wildfly-swarm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245642722,"owners_count":20648906,"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","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":"2025-01-31T12:30:53.457Z","updated_at":"2025-03-26T11:25:41.963Z","avatar_url":"https://github.com/bugbiteme.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inventory-wildfly-swarm\n\nThis microservice can be run on it's own, but is intended to be run as part of the \"coolstore\" project in openshift.\n\nInstructions for deploying the entire coolstore application will be available soon.\n\n## Run inventory-wildfly-swarm as a stand-alone RestAPI service running locally\n\nUsing maven, run the following command to run and test the inventory microservice locally:\n\n`$ mvn package`\n\nthen\n\n`$ mvn wildfly-swarm:run`\n\nOnce you see `WildFly Swarm is Ready`\n\nvalidate it is running using curl (or a web browser)\n\n`curl http://localhost:9001/api/inventory/329299`\n \n output\n \n`{\"itemId\":\"329299\",\"quantity\":35}`\n\nterminate service `ctrl-c`\n\n## Build and deploy inventory service on OpenShift. \n\nAssuming you have logged into OpenShift, make sure you are in the coolstore project:\n\n`$ oc project coolstore`\n\n### Deploying from local source using Maven\nTo build and deploy the inventory service into OpenShift using the fabric8 maven plugin, run the following Maven command:\n\n`$ mvn fabric8:deploy`\n\nWhile you are waiting for the deploy command to complete, you can log into the OpenShift web consol and check the progress of your deployment, and even view the build and deployment logs, which should look very similar to the messages seen when running the service locally.\n\nOnce the service has been deployed, you can get the url by running\n\n`$ oc get route`\n\n### Deploying from github\nThe Java S2I image enables developers to automatically build, deploy and run java applications on demand, in OpenShift Container Platform, by simply specifying the location of their application source code or compiled java binaries. In many cases, these java applications are bootable “fat jars” that include an embedded version of an application server and other frameworks (wildfly-swarm in this instance). \n\nBefore we start using the Java S2I image we need to tell OpenShift how to find it. This is done by creating an image stream. The image stream definition can be downloaded and used. To add the image stream to your project run the following command:\n\n`$ oc create -f openjdk-s2i-imagestream.json`\n\nNow you can deploy the service from github\n\n`$ oc new-app https://github.com/bugbiteme/inventory-wildfly-swarm.git --name inventory --image-stream=redhat-openjdk18-openshift`\n\nA build gets created and starts building the Node.js Web UI container image. You can see the build logs using OpenShift Web Console or OpenShift CLI:\n\n`$ oc logs -f bc/inventory`\n\nIn order to access the Web UI from outside (e.g. from a browser), it needs to get added to the load balancer. Run the following command to add the Web UI service to the built-in HAProxy load balancer in OpenShift.\n\n~~~\n$ oc expose svc/inventory\n$ oc get route inventory\n~~~\n\nWhile you are waiting for the deploy command to complete, you can log into the OpenShift web consol and check the progress of your deployment, and even view the build and deployment logs, which should look very similar to the messages seen when running the service locally.\n\n\n### Validate \nValidate the inventory service is running using curl (or a web browser)\n\n`curl http://SERVICE_ROUTE_OPENSHIFT_URL/api/inventory/329299`\n \n output\n \n`{\"itemId\":\"329299\",\"quantity\":35}`\n\nFor more information:\n[http://guides-cdk-roadshow.b9ad.pro-us-east-1.openshiftapps.com/index.html#/workshop/roadshow/module/wildfly-swarm](http://guides-cdk-roadshow.b9ad.pro-us-east-1.openshiftapps.com/index.html#/workshop/roadshow/module/wildfly-swarm)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugbiteme%2Finventory-wildfly-swarm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugbiteme%2Finventory-wildfly-swarm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugbiteme%2Finventory-wildfly-swarm/lists"}