Skip to content

Commit bc757e8

Browse files
mxr576jonaseberle
authored andcommitted
Install DDEV binary manually instead via APT
More details in #42 (comment)
1 parent 323f5d3 commit bc757e8

File tree

4 files changed

+519
-124
lines changed

4 files changed

+519
-124
lines changed

README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,99 @@ default: `latest`
8484
version: 1.22.4
8585
```
8686

87+
### installScriptUrl
88+
89+
URL to the DDEV installation script. This allows you to specify a custom or alternative source for the DDEV installation script.
90+
91+
default: `https://raw.githubusercontent.com/ddev/ddev/master/scripts/install_ddev.sh`
92+
93+
```
94+
- uses: ddev/github-action-setup-ddev@v1
95+
with:
96+
installScriptUrl: "https://raw.githubusercontent.com/ddev/ddev/v1.22.4/scripts/install_ddev.sh"
97+
```
98+
99+
This option is useful for:
100+
- Using a specific version of the installation script from a tagged release
101+
- Testing with a development version from a specific branch
102+
- Using a forked or modified version of the installation script
103+
- Working with air-gapped environments that require local script hosting
104+
105+
Example with custom script source:
106+
107+
```
108+
- name: Setup DDEV with custom installation script
109+
uses: ddev/github-action-setup-ddev@v1
110+
with:
111+
installScriptUrl: "https://my-company.com/scripts/custom_ddev_install.sh"
112+
version: "v1.22.4"
113+
retryAttempts: 3
114+
```
115+
116+
### Retry configuration options
117+
118+
The action includes built-in retry logic with exponential backoff for improved reliability in CI/CD environments. These options are all optional and have sensible defaults.
119+
120+
#### retryAttempts
121+
122+
Maximum number of retry attempts for DDEV installation and operations.
123+
124+
default: `5`
125+
126+
```
127+
- uses: ddev/github-action-setup-ddev@v1
128+
with:
129+
retryAttempts: 5
130+
```
131+
132+
#### initialDelay
133+
134+
Initial delay in seconds between retries.
135+
136+
default: `2`
137+
138+
```
139+
- uses: ddev/github-action-setup-ddev@v1
140+
with:
141+
initialDelay: 5
142+
```
143+
144+
#### maxDelay
145+
146+
Maximum delay in seconds between retries. This prevents the delay from growing too large with exponential backoff.
147+
148+
default: `30`
149+
150+
```
151+
- uses: ddev/github-action-setup-ddev@v1
152+
with:
153+
maxDelay: 60
154+
```
155+
156+
#### retryMultiplier
157+
158+
Delay multiplier for exponential backoff. Each retry will multiply the previous delay by this value.
159+
160+
default: `2`
161+
162+
```
163+
- uses: ddev/github-action-setup-ddev@v1
164+
with:
165+
retryMultiplier: 3
166+
```
167+
168+
#### jitterPercent
169+
170+
Jitter percentage (0-100) to add randomness to retry delays. This helps prevent thundering herd problems when multiple jobs retry simultaneously.
171+
172+
default: `25`
173+
174+
```
175+
- uses: ddev/github-action-setup-ddev@v1
176+
with:
177+
jitterPercent: 50
178+
```
179+
87180
## Common recipes
88181

89182
### SSH keys

action.yml

Lines changed: 90 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,100 @@
1-
name: 'Setup DDEV in Github Workflows'
2-
description: |
3-
This action installs **DDEV** in your Github Workflow.
1+
name: 'Setup and start DDEV action'
2+
description: 'Set up your GitHub Actions workflow with DDEV'
43
author: 'Jonas Eberle and DDEV contributors'
5-
runs:
6-
using: 'node20'
7-
main: 'lib/main.js'
8-
branding:
9-
icon: cpu
10-
color: yellow
4+
115
inputs:
126
ddevDir:
13-
description: 'ddev project directory'
7+
description: 'Path to your DDEV project. This path needs to contain the .ddev/ directory.'
148
required: false
159
default: '.'
10+
1611
autostart:
17-
description: 'Start ddev automatically'
12+
description: 'Starts your DDEV project immediately.'
1813
required: false
19-
default: true
14+
default: 'true'
15+
2016
version:
21-
description: 'Install a specific ddev version, such as 1.22.4'
17+
description: 'Install a specific DDEV version. Example: 1.24.0'
2218
required: false
2319
default: 'latest'
20+
21+
retryAttempts:
22+
description: 'Maximum number of retry attempts for DDEV installation and operations'
23+
required: false
24+
default: '5'
25+
26+
initialDelay:
27+
description: 'Initial delay in seconds between retries'
28+
required: false
29+
default: '2'
30+
31+
maxDelay:
32+
description: 'Maximum delay in seconds between retries'
33+
required: false
34+
default: '30'
35+
36+
retryMultiplier:
37+
description: 'Delay multiplier for exponential backoff'
38+
required: false
39+
default: '2'
40+
41+
jitterPercent:
42+
description: 'Jitter percentage (0-100) to add randomness to retry delays'
43+
required: false
44+
default: '25'
45+
46+
installScriptUrl:
47+
description: 'URL to the DDEV installation script'
48+
required: true
49+
default: 'https://raw.githubusercontent.com/ddev/ddev/master/scripts/install_ddev.sh'
50+
51+
runs:
52+
using: 'composite'
53+
steps:
54+
- name: Download DDEV install script
55+
shell: bash
56+
run: |
57+
"${{ github.action_path }}/scripts/retry.sh" \
58+
--attempts "${{ inputs.retryAttempts }}" \
59+
--initial-delay "${{ inputs.initialDelay }}" \
60+
--max-delay "${{ inputs.maxDelay }}" \
61+
--multiplier "${{ inputs.retryMultiplier }}" \
62+
--jitter "${{ inputs.jitterPercent }}" \
63+
--description "Download DDEV install script" \
64+
-- curl -fsSL --retry 3 --retry-max-time 60 --retry-connrefused \
65+
-o /tmp/install_ddev.sh \
66+
"${{ inputs.installScriptUrl }}"
67+
68+
- name: Install DDEV
69+
shell: bash
70+
run: |
71+
if [[ '${{ inputs.version }}' != 'latest' ]]; then
72+
VERSION_ARG="v${{ inputs.version }}"
73+
echo "Installing DDEV version: ${VERSION_ARG}"
74+
else
75+
VERSION_ARG=""
76+
echo "Installing latest DDEV version"
77+
fi
78+
79+
# Make installation script executable
80+
chmod +x /tmp/install_ddev.sh
81+
82+
"${{ github.action_path }}/scripts/retry.sh" \
83+
--attempts "${{ inputs.retryAttempts }}" \
84+
--initial-delay "${{ inputs.initialDelay }}" \
85+
--max-delay "${{ inputs.maxDelay }}" \
86+
--multiplier "${{ inputs.retryMultiplier }}" \
87+
--jitter "${{ inputs.jitterPercent }}" \
88+
--description "DDEV installation" \
89+
-- /tmp/install_ddev.sh ${VERSION_ARG}
90+
91+
- name: Start DDEV project
92+
shell: bash
93+
working-directory: ${{ inputs.ddevDir }}
94+
if: inputs.autostart == 'true'
95+
run: |
96+
ddev start
97+
98+
branding:
99+
icon: 'cpu'
100+
color: yellow

lib/main.js

Lines changed: 0 additions & 111 deletions
This file was deleted.

0 commit comments

Comments
 (0)