Source Code Deployment

Shipa supports deploying applications from source code.

Shipa uses Cloud Native Buildpacks to deploy applications from source code. You can use a specific builder (default heroku/buildpacks:20) with deploy --builder flag. You can also provide one or more build packs using --build-packs flag.

Cloud-native Buildpacks can be used to deploy many languages and frameworks, e.g., go, ruby, python, dotnet, java, nodejs, PHP, etc.

You can search the Cloud-native build packs registry to find which buildpacks to use: https://registry.buildpacks.io/.

Follow the instructions below to deploy a sample python application from source code:

Creating The Application

Create an application on Shipa using the following command:

shipa app create python-sample -t shipa-admin-team -k shipa-framework

Deploying The Application

You can clone the Python sample app from the following repository:

git clone [email protected]:shipa-corp/python-sample.git && cd python-sample
shipa app deploy -a python-sample . -i $YOUR_DOCKER_REGISTRY/python-sample:1.0 --shipa-yaml ./shipa.yml

The following steps are performed during the deployment of the source code:

  • Buildpack builder (default heroku/buildpacks:20), auto-detects which buildpack to use (in this case it uses python pack) and it also uses Procfile from the root of the app directory
  • It builds a docker image and publishes it to the provided image URL $YOUR_DOCKER_REGISTRY/python-sample:1.0. This image is used to perform the deployment.
  • The Python app listens on port 5000. We use the shipa.yaml file to define the target port and setup ingress so ingress traffic can reach the application.
+-------------+-----------+---------------+-------------------------------------------------------------------------------------------------------------+
| Application | Status    | Shipa Managed | Address                                                                                                     |
+-------------+-----------+---------------+-------------------------------------------------------------------------------------------------------------+
|python-sample| 1 running | true          | http://python-sample.aac76f8a4ec854f64bf40eb7f030d65a-1452212745.us-west-2.elb.amazonaws.com.shipa.cloud    |
+-------------+-----------+---------------+-------------------------------------------------------------------------------------------------------------+

📘

--builder and --build-packs option

Shipa uses heroku/buildpacks:20 by default during the build phase when deploying from source, it auto-detects language and framework to build and create docker image and it also publishes it to the image registry URL specified with -i option.

You can use --build-packs to specify a specific pack or in cases where you want to use your own pack. you can specify more than one pack by separating them by a comma.


Did this page help you?