Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ambient-impact/drupal-digitalocean-function-cron

DigitalOcean Function to ping a Drupal cron URL via scheduled triggers.
https://github.com/ambient-impact/drupal-digitalocean-function-cron

digitalocean digitalocean-functions drupal php

Last synced: 22 days ago
JSON representation

DigitalOcean Function to ping a Drupal cron URL via scheduled triggers.

Awesome Lists containing this project

README

        

[DigitalOcean Function](https://docs.digitalocean.com/products/functions/) to
ping a Drupal cron URL via [scheduled
triggers](https://docs.digitalocean.com/products/functions/how-to/schedule-functions/).

# Configuring and Deploying

The easiest way to deploy this is to [install and configure
`doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/). Then,
check out this repository. Next, create [a `.env`
file](https://www.dotenv.org/docs/security/env.html) in the root of the
repository with the contents:

```env
CRON_URL=YOUR_URL
```

Where `YOUR_URL` is the cron URL Drupal offers you on the
`/admin/config/system/cron` page of the site you want to ping the cron of. Note
that it's also possible to place this file elsewhere and use [the `--env`
flag](https://docs.digitalocean.com/reference/doctl/reference/serverless/deploy/#flags)
when running `doctl serverless deploy`.

Before you can deploy your function, [you'll need to create a namespace either
via the control panel or via
`doctl`](https://docs.digitalocean.com/products/functions/how-to/create-namespaces/).

Once you have a namespace, connect to it:

```bash
doctl serverless connect
```

Now `doctl` knows where to deploy the function. To do so, run:

```bash
doctl serverless deploy /path/to/repository
```

Where `/path/to/repository` is either the absolute path to the folder
containing this readme or a relative path to the current directory. For more
information, see [the documentation for
`doctl serverless deploy`](https://docs.digitalocean.com/reference/doctl/reference/serverless/deploy/).