Launching an application
In this recipe, you will learn how to launch an application using the Marathon API. We will create our first application using the API and then write a simple Python script to obtain information about where it has been deployed. Marathon provides a REST API that allows us to easily wire it with CI/CD systems using a simple script.
Getting ready
Before you start, ensure Marathon is up and running.
How to do it...
When you log in to Marathon, you can manually click to deploy an application. The Marathon UI is great, but limited to performing only basic deployments. In the following examples, you will see how to interact with Marathon using its API. This will enable you to plug in Marathon as a final step of your CI/CD solution.
There are two types of applications: native and Docker.
- The first example will show how to deploy a simple web server:
cat <<EOF > caddy.json { "id": "web/server", "cmd": "echo \"It's working!\" > index.html && ./caddy_linux_amd64...