This challenge will get you familiar with the steps needed to run a native build on Tanzu Application Platform (TAP). We use the basics from the Native build with TAP demo, but here we use a different accelerator, the tanzu-java-web-app
one. If you know how to "copy-and-paste", then you should be all set for this challenge.
This is a "cheat sheet" for the commands you need to run:
- Sign up and start a new sandbox lab
- Copy the link to "Tanzu Developer Portal" provided under "Getting started".
- Set the env var
ACC_SERVER_URL
to the link you just copied (replace the URL in the example with the one you just copied)export ACC_SERVER_URL=https://tap-gui.tapb-engaging-sunbird.tapsandbox.com/
- Generate a project from the spring-cloud-serverless accelerator
tanzu accelerator generate tanzu-java-web-app --options '{"buildTool" : "maven", "javaVersion" : "17", "nativeBuild" : true, "projectName" : "hello-native", "springBootVersion" : "3.1"}'
- Unzip and cd to the app directory
unzip hello-native.zip cd hello-native
- Deploy the native workload
tanzu apps workload create hello-native -y -f config/workload-native.yaml --local-path .
- Play some elevator music while you wait for the build to finish (~15 min)
tanzu apps workload get hello-native
- When the app becomes ready it will show a URL, capture that URL
APP_URL=$(kubectl get service.serving.knative.dev/hello-native -ojsonpath='{.status.url}')
- Invoke the app using
curl
curl -w'\n' $APP_URL