Report this

What is the reason for this report?

How to use app-spec.yaml in App Platform and doctl?

Posted on January 22, 2021

Hello everyone, I don’t understand from documentation how to use App Platform with doctl. Specifically, how can I release a deployment with a yaml contained in the repository? I see that there is the following command:

doctl apps create-deployment

But I don’t understand how to connect the yaml file. And in general the auto deploy connected to a branch how do you tell it to use the yaml file present in the repository?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Thanks very much Bojand for your explanation. Last question if I can ask:

I have a Laravel app. In the first deploy, example, I have to launch the following commands:

php artisan migrate php artisan db:seed

In a second release I have the following command:

php artisan optimize

What is the best practice? Update commands in dashboard or other?

Thanks in advance

Hello, sorry if this is misleading help text. A deployment is an instance of an app in time. This is implying that the deployment created will use whatever the current spec of the app is within App Platform. We will try and improve this wording.

The app spec yaml file is used to create an app using doctl CLI.

doctl apps create --spec <path-to-spec>

Alternatively you can create an app using the dashboard by connecting to source control such as GitHub or GitLab.

Regardless of the creation mechanism, once an app is created, you can initiate a new deployment using the command:

doctl apps create-deployment <app id>

You can get app IDs by listing apps:

doctl apps list

You can retrieve the app’s spec using spec command:

doctl apps spec get <app id>

The app spec is only used to create or update an app.

Here are command line documentation

Hope this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.