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

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?

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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!