diff --git a/docs/ddev-providers.md b/docs/ddev-providers.md index 74ddb44..5cca97e 100644 --- a/docs/ddev-providers.md +++ b/docs/ddev-providers.md @@ -20,6 +20,14 @@ An rsync-based provider for pulling a DB dump from a host called "Tibus", run in - `auth_command` checks `ssh-add -l` succeeds, erroring with instructions to run `ddev auth ssh` first if not. - `db_pull_command` (`service: web`) runs `rsync -az -e "ssh -J ${AEGIR_USERNAME}@anrt.vpn" "${dburl}" /var/www/html/.ddev/.downloads/db.sql.gz`, tunneling through an Aegir jump host. +## gitlab.yaml (GitLab CI artifact provider) + +Pulls a database dump published as a GitLab CI job artifact, using the `glab` CLI. + +- Defines only `db_pull_command` (`service: host`). +- Runs `glab ci artifact dev db:artifact --path=".ddev/.downloads"` to download the artifact, then `ddev import-db --file=.ddev/.downloads/db.sql.gz` to import it. +- Used via `ddev pull gitlab --skip-files` (the file header also notes `ddev remote-db` as an entry point). + ## Selecting the active provider The active provider name is stored as `DDEV_UPSTREAM_PROVIDER` in `.ddev/.env.anner` (read via `ddev dotenv`): diff --git a/scripts/provider-samples/gitlab.yaml b/scripts/provider-samples/gitlab.yaml new file mode 100755 index 0000000..294b300 --- /dev/null +++ b/scripts/provider-samples/gitlab.yaml @@ -0,0 +1,16 @@ +# Gitlab Provider. + +# This will pull a database from gitlab artifacts using `glab` command. +# +# To use this configuration run: +# +# - `ddev remote-db` +# - `ddev pull gitlab --skip-files` + +db_pull_command: + command: | + # set -x # You can enable bash debugging output by uncommenting + set -eu -o pipefail + glab ci artifact dev db:artifact --path=".ddev/.downloads" + ddev import-db --file=.ddev/.downloads/db.sql.gz + service: host