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:
Environment
You can deploy application to a target cluster in a namespace using set of policies (framework). To do this you should create environment, for details see: Managing Environments
Deploy Application from source
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 -k sample-framework -t shipa-team . -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.
Private Registry
You can pass the
--private-image
flag in the UI and input the user/token interactively to authenticate or export two environmental variables.export SHIPA_REGISTRY_USERNAME="arn:aws:iam::123456789:user/bacon" export SHIPA_REGISTRY_PASSWORD="abcdefg#/abcdefg#/" shipa app deploy -a python-sample . -i *.dkr.ecr.us-east-1.amazonaws.com/python-sample:1.0 --shipa-yaml ./shipa.yml --private-image
Updated 3 months ago