Add daily email for 2024-07-26
Using a run file in your CI pipeline
This commit is contained in:
parent
0ef27be114
commit
3bd0c78dc3
34
source/_daily_emails/2024-07-26.md
Normal file
34
source/_daily_emails/2024-07-26.md
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
---
|
||||||
|
title: Using a run file in your CI pipeline
|
||||||
|
date: 2024-07-26
|
||||||
|
permalink: daily/2024/07/26/using-a-run-file-in-your-ci-pipeline
|
||||||
|
tags:
|
||||||
|
- software-development
|
||||||
|
- continuous-integration
|
||||||
|
cta: ~
|
||||||
|
snippet: |
|
||||||
|
How I use a `run` file within my CI pipelines.
|
||||||
|
---
|
||||||
|
|
||||||
|
[One of my earliest daily emails was about `run` files][0] - files that contain Bash functions that combine or simplify project-specific tasks.
|
||||||
|
|
||||||
|
In Drupal projects, these could be to execute Composer or Drush commands, connect to the database, or run automated tests.
|
||||||
|
|
||||||
|
For my CI pipelines, I like to use a function called `ci:test` that contains all the commands to run in the pipeline.
|
||||||
|
|
||||||
|
This keeps the pipeline configuration as simple and agnostic as possible.
|
||||||
|
|
||||||
|
It also makes it easy for people to read and, because it's a bash file, it will run anywhere without any additional tools.
|
||||||
|
|
||||||
|
For an example, [see my Drupal Docker example repository][1].
|
||||||
|
|
||||||
|
## Here's the thing
|
||||||
|
|
||||||
|
The main advantage, though, is being able to run the pipeline locally, if you need to.
|
||||||
|
|
||||||
|
Maybe you need to debug a failure in the pipeline or you want to test a change to the pipeline locally before pushing it.
|
||||||
|
|
||||||
|
By using a command in a `run` file, doing so is as simple as running that one command.
|
||||||
|
|
||||||
|
[0]: {{site.url}}/daily/2022/08/15/using-run-file-simplify-project-tasks
|
||||||
|
[1]: https://github.com/opdavies/docker-example-drupal/blob/d18bf2242fba1291cabf1e16a5badb6fda7ce509/run#L16-L35
|
Loading…
Reference in a new issue