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?

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.

×
Submit an Answer
2 answers

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!

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