there are two technology stacks available for you to deploy your example application: Kyma and Cloud Foundry. The Cloud Foundry requires less steps and is therefore recommended. We tested all steps to the best of our knowledge, but of course can't guarantee that all parts stay stable over time. So, if you encounter issues, please reach out to us via the github repository linked below.
You can find all necessary steps in the project repository. If you want to use the preconfigured vm-image, please find it here (only accessible for SAP employees).
For reference, we state the steps for the Cloud Foundry tutorial also here. You do not need to do them all beforehand, but we recommend to follow the steps alongside the next videos.
Best success, the egc1 Teaching-Team
Cloud Foundry version of the emojify application
This is a the nodejs variant of the emojify application adapted to be deployed on Cloud Foundry. In this tutorial, you will deploy the existing application on Cloud Foundry running within the SAP Business Technology Platform.
Requirements
There are no special requirements to deploy the application to Cloud Foundry. Everything needed will be handled in the description below.
Preparation
In general, there are two ways to complete this short hands-on exercise. Either via the Business Application studio in the web (Option A), or via git and the command line on your local machine (Option B).
Enable your trial instance on the SAP Business Technology Platform via https://cockpit.hanatrial.ondemand.com/trial/#/home/trial
Once your trial instance is ready, enter the subaccount "trial" which should be there already. (If it is missing, create a subaccount and enable Cloud Foundry for it.)
Option A: Business Application Studio
Go to the subscriptions within your subaccount. [ If SAP Business Application studio is not yet available, enable the "SAP Business Application Studio" (via the Create Button in the top right corner).]
Open the SAP Business Application Studio by clicking on the link under subscriptions (or click "Go to Application", if you just added the subscription).
Click on "Create Dev Space" enter a "Dev Space name" that you like (e.g. emojify-dev-space) and select "Full Stack Cloud Application" as kind of application. Finish the creation by clicking "Create Dev Space"
Once your space is ready open it and select "Clone from Git" from the welcome page. Enter the following URL to clone the repository: https://github.com/akrausesap/kyma-emoji.git
Click on "Open Workspace" and select kyma-emoji and open it.
Open the manifest.yml file in the cf-nodejs folder. Change the following values:
Line 3 name --> change the name to be uniqe, e.g. add your name and a random number to the end of the existing application name. The application name needs to be unique (for all users). Warning: do not use underscores. A good example is emojicfjohndoe1337 ( but please do not use that, it is already taken. ;-) )
Line 9 name --> same as in line 3, the name of the app router has to be unique. For example, once more add your name and a number to the existing name, so that it looks like this: emojicfaprjohndoe1337
Line 17 url --> the part after "https://" has to match your application name in line 3, so in our example case the full URL looks as follows: https://emojicfjohndoe1337.cfapps.eu10.hana.ondemand.com
Open a terminal via the Menu at the top border: Terminal --> New Terminal
Type cf login to log on to your BTP Trial Instance (enter your matching API Endpoint for the region you chose when creating your account, e.g. https://api.cf.eu10.hana.ondemand.com for EU)
Navigate to the cf-nodejs subfolder via cd cf-nodejs
Create the necessary service instances:
Create the Authorization Service by typing: cf cs xsuaa application emojicf-uaa -c ./security/xs-security.json
Create the Application Log Service by typing: cf cs application-logs lite emojicf-al
Deploy the application by typing cf push
Open the cloud cockpit in your browser: https://cockpit.hanatrial.ondemand.com/
Go to to your Cloud Foundry space. You should see two applications. Select the application router (the one having the apr in the app-name, the name that you entered in the manifest.yml in Line 9) and open the displayed route in the browser (Hint: do not click on the link, but copy it into the address bar of a browser, as it is not correctly linked by default).
Enter a name and hit emojify :-)
Option B: Cloud Foundry CLI, a local git client and the command line
(you need the Cloud Foundry cli, a git client and an editor. The installation instructions for the Cloud Foundry CLI can be found here: https://docs.cloudfoundry.org/cf-cli/install-go-cli.html)
Open your command line, go to a folder of your liking and clone the project repository via git clone https://github.com/akrausesap/kyma-emoji.git
Navigate to the cf-nodejs folder and change the manifest.yml file as follows:
Line 3 name --> change the name to be uniqe, e.g. add your name and a random number to the end of the existing application name. The application name needs to be unique (for all users). Warning: do not use underscores. A good example is emojicfjohndoe1337 ( but please do not use that, it is already taken. ;-) )
Line 9 name --> same as in line 3, the name of the app router has to be unique. For example, once more add your name and a number to the existing name, so that it looks like this: emojicfaprjohndoe1337
Line 17 url --> the part after "https://" has to match your application name in line 3, so in our example case the full URL looks as follows: https://emojicfjohndoe1337.cfapps.eu10.hana.ondemand.com
Log into your BTP Trial Instance via cf login. As above, use your matching API endpoint, username and password.
Open the cloud cockpit in your browser: https://cockpit.hanatrial.ondemand.com/
Go to to your Cloud Foundry space. You should see two applications. Select the application router (the one having the apr in the app-name, the name that you entered in the manifest.yml in Line 9) and open the displayed route in the browser (Hint: do not click on the link, but copy it into the address bar of a browser, as it is not correctly linked by default).