This web application consists on a number of quizes coming from Open Trivia Database. It is built in Java EE with IBM Open Liberty web server.
It is deployed in IBM Cloud as a Cloud Foundry application (Liberty for Java). The webapp can be accessed here:
https://trivial-asr.eu-gb.mybluemix.net
This web application is based in the following microservices, provided by IBM Cloud:
Moreover, it uses IBM Cloud CI/CD tools to use DevOps and improve the coding experience.
In order to have all microservices running correctly and integrated with the application, you need an IBM Cloud account.
Next, you will need to create the services mentioned before. Once created, you can generate credentials for local use, generated as a JSON file. You should get the "apikey"
and the "url"
from each service and copy them in their corresponding properties file of resources. Remember to remove "template" from the filenames.
The App ID service is more complicated. I recommend reading the documentation and watching some videos of this YouTube playlist, especially this one.
To make App ID work, you must take password from line 13 of server.xml and put it in line 25 of server.template.xml. Moreover, you have to put the required data from the App ID service credentials in lines 33, 34 and 35. And finally, remember to remove "template" from the filename.
Finally, and assuming that Java 1.8 and Maven are correctly installed, you can clone this repository and run the following commands in a terminal:
cd trivial-asr
mvn clean install
mvn liberty:dev -DskipTests=true
The web server will be listening at http://localhost:9080
.
For this, you will need to create a Cloud Foundry application on IBM Cloud. You may need to modify the configurations of the manifest.yaml (possibly name
, path
, routes
, and services
).
Before deploying the application, you should run the scripts build_server.sh
and prod_server.sh
. These scripts will produce a ZIP file with the packaged Liberty server.
Assuming that Cloud Foundry CLI is installed in your system, the folloging commands will deploy your application to IBM Cloud:
cf api <the API domain where the Cloud Foundry app is created>
cf login # You will be asked for email and password of the IBM Cloud account
cf push
cf logout
For this task, you have to enable Continuous Delivery in the Cloud Foundry application, from IBM Cloud. You will need to specify the Git URL and the commands to execute on the stages you define.
This is the advanced level. If you have arrived here, sure you know how to configure CI/CD in your application.
Hope it is useful! 😄