Skip to content

Commit 5ed0126

Browse files
committed
Add examples to README.md
1 parent 6f4fa4e commit 5ed0126

File tree

3 files changed

+74
-15
lines changed

3 files changed

+74
-15
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[{*.yml,*.yaml,*.yaml.tpl}]
12+
indent_size = 2
13+
14+
[{Makefile,**.mk}]
15+
indent_style = tab

README.md

+54-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,61 @@
1+
![Geek Cell GmbH](https://uploads-ssl.webflow.com/61d1d8051145e270217e36a1/61d205833226d492ab02ad46_Group%202.svg "Geek Cell GmbH")
2+
3+
It's 100% Open Source and licensed under the [APACHE2](LICENSE).
4+
15
<!-- action-docs-description -->
26
## Description
37

4-
This action makes it possible to run an AWS ECS Fargate task.
8+
Run an AWS ECS Fargate task and execute a custom commands. See the log output of the commands.
59
<!-- action-docs-description -->
610

11+
### Details
12+
This action makes it possible to run an AWS ECS Fargate task and execute a custom command. If the task definition
13+
defines logs to CloudWatch this action will also tail the output of container, providing instant feedback inside
14+
the GitHub Workflow.
15+
16+
This action is great for executing migrations or other pre/post deployment steps for ECS Fargate applications.
17+
718
## Usage
819

20+
#### Full example
921
``` yaml
10-
---
11-
#TODO
22+
- name: Execute migrations and seeders
23+
id: run-task
24+
uses: geekcell/[email protected]
25+
with:
26+
cluster: application-cluster
27+
task-definition: application-task-def
28+
assign-public-ip: 'DISABLED'
29+
30+
subnet-ids: |
31+
subnet-04f133a104b9e95df
32+
subnet-0dc419ee6a1483514
33+
34+
security-group-ids: |
35+
sg-123456789101112
36+
sg-112398765421333
37+
38+
tail-logs: true
39+
override-container: app
40+
override-container-command: |
41+
/bin/sh
42+
-c
43+
php artisan migrate --force --ansi && \
44+
php artisan db:seed --force --ansi && \
45+
php artisan config:clear --ansi
1246
```
1347
48+
#### Minimal example
49+
``` yaml
50+
- name: Run migration container
51+
id: run-task
52+
uses: geekcell/[email protected]
53+
with:
54+
cluster: application-cluster
55+
task-definition: application-task-def
56+
subnet-ids: subnet-04f133a104b9e95df
57+
security-group-ids: sg-123456789101112
58+
```
1459
1560
<!-- action-docs-inputs -->
1661
## Inputs
@@ -20,24 +65,24 @@ This action makes it possible to run an AWS ECS Fargate task.
2065
| task-definition | The name or the ARN of the task definition to use for the task. | `true` | |
2166
| subnet-ids | The list of subnet IDs for the task to use. If multiple they should be passed as multiline argument with one subnet ID per line. | `true` | |
2267
| security-group-ids | List of security group IDs for the task. If multiple they should be passed as multiline argument with one subnet ID per line. | `true` | |
23-
| assign-public-ip | Assign public a IP to the task. Options: ['ENABLED', 'DISABLED'] | `false` | DISABLED |
24-
| cluster | Which ECS cluster to start the task in. | `false` | default |
68+
| assign-public-ip | Assign public a IP to the task. Options: `['ENABLED', 'DISABLED']` | `false` | DISABLED |
69+
| cluster | Which ECS cluster to start the task in. | `false` | |
2570
| override-container | Will use `containerOverrides` to run a custom command on the container. If provided, `override-container-command` must also be set. | `false` | |
2671
| override-container-command | The command to run on the container if `override-container` is passed. | `false` | |
27-
| tail-logs | If set to true, will try to extract the logConfiguration for the first container in the task definition. If `override-container` is passed, it will extract the logConfiguration from that container. Tailing logs is only possible if the provided container uses the `awslogs` logDriver. | `false` | true |
72+
| tail-logs | If set to true, will try to extract the logConfiguration for the first container in the task definition. If `override-container` is passed, it will extract the logConfiguration from that container. Tailing logs is only possible if the provided container uses the `awslogs` logDriver. | `false` | true |
2873
<!-- action-docs-inputs -->
2974

3075
<!-- action-docs-outputs -->
3176
## Outputs
3277

3378
| parameter | description |
3479
| --- | --- |
35-
| task-arn | The full ARN for the task that was ran. |
36-
| task-id | The ID for the task that was ran. |
80+
| task-arn | The full ARN for the task that was ran. Will be added as ENV variable. |
81+
| task-id | The ID for the task that was ran. Will be added as ENV variable. |
3782
<!-- action-docs-outputs -->
3883

3984
<!-- action-docs-runs -->
4085
## Runs
4186

42-
This action is a `node12` action.
87+
This action is a `node16` action.
4388
<!-- action-docs-runs -->

action.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 'Run AWS ECS Fargate Task'
22
description: >-
3-
This action makes it possible to run an AWS ECS Fargate task.
3+
Run an AWS ECS Fargate task and execute a custom commands. See the log output of the commands.
44
55
branding:
66
icon: 'activity'
@@ -24,14 +24,13 @@ inputs:
2424
assign-public-ip:
2525
description: >-
2626
Assign public a IP to the task.
27-
Options: ['ENABLED', 'DISABLED']
27+
Options: `['ENABLED', 'DISABLED']`
2828
required: false
2929
default: DISABLED
3030
cluster:
3131
description: >-
3232
Which ECS cluster to start the task in.
3333
required: false
34-
default: default
3534
override-container:
3635
description: >-
3736
Will use `containerOverrides` to run a custom command on the container. If provided, `override-container-command`
@@ -43,17 +42,17 @@ inputs:
4342
required: false
4443
tail-logs:
4544
description: >-
46-
If set to true, will try to extract the logConfiguration for the first container in the task definition. If
45+
If set to true, will try to extract the logConfiguration for the first container in the task definition. If
4746
`override-container` is passed, it will extract the logConfiguration from that container. Tailing logs is only
4847
possible if the provided container uses the `awslogs` logDriver.
4948
required: false
5049
default: 'true'
5150

5251
outputs:
5352
task-arn:
54-
description: 'The full ARN for the task that was ran.'
53+
description: 'The full ARN for the task that was ran. Will be added as ENV variable.'
5554
task-id:
56-
description: 'The ID for the task that was ran.'
55+
description: 'The ID for the task that was ran. Will be added as ENV variable.'
5756

5857
runs:
5958
using: 'node16'

0 commit comments

Comments
 (0)