You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Initial commit. Missing order definition.
* Made tf file not fail if empty value passed
* Added option to define Repo and AWS env files
* Updated README
Copy file name to clipboardExpand all lines: README.md
+39-5Lines changed: 39 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,20 +8,52 @@ The action will copy this repo to the VM and then run `docker-compose up`.
8
8
Your app needs a `Dockerfile` and a `docker-compose.yaml` file.
9
9
10
10
> For more details on setting up Docker and Docker Compose, check out Bitovi's Academy Course: [Learn Docker](https://www.bitovi.com/academy/learn-docker.html)
11
+
>
12
+
## Environment variables
13
+
14
+
For envirnoment variables in your app, you can provide a `repo_env` file in your repo, a `.env` file in GitHub Secrets named `DOT_ENV`, or an AWS Secret. Then hook it up in your `docker-compose.yaml` file like:
11
15
12
-
For envirnoment variables in your app, provide a `.env` file in GitHub Secrets named `DOT_ENV` and hook it up in your `docker-compose.yaml` file like:
13
16
```
14
17
version: '3.9'
15
18
services:
16
19
app:
17
20
env_file: .env
18
21
```
19
22
23
+
These environment variables are merged to the .env file quoted in the following order:
24
+
- Terraform passed env vars ( This is not optional nor customizable )
25
+
- Repository checked-in env vars - repo_env file as default. (KEY=VALUE style)
26
+
- Github Secret - Create a secret named DOT_ENV - (KEY=VALUE style)
27
+
- AWS Secret - JSON style like '{"key":"value"}'
28
+
20
29
## Example usage
21
30
22
31
Create `.github/workflow/deploy.yaml` with the following to build on push.
@@ -79,15 +111,17 @@ The following inputs can be used as `step.with` keys
79
111
| `domain_name` | String | Define the root domain name for the application. e.g. bitovi.com' |
80
112
| `sub_domain` | String | Define the sub-domain part of the URL. Defaults to `${org}-${repo}-{branch}` |
81
113
| `tf_state_bucket` | String | AWS S3 bucket to use for Terraform state. Will be deleted if stack_destroy set to true |
82
-
| `dot_env` | String | `.env` file to be used with the app |
114
+
| `repo_env` | String | `.env` file containing environment variables to be used with the app. Name defaults to `repo_env`. Check **SEnvironment variables** note |
115
+
| `dot_env` | String | `.env` file to be used with the app. This is the name of the [Github secret](https://docs.github.com/es/actions/security-guides/encrypted-secrets). Check **SEnvironment variables** note |
116
+
| `aws_secret_env` | String | Secret name to pull environment variables from AWS Secret Manager. Check **SEnvironment variables** note |
83
117
| `app_port` | String | port to expose for the app |
84
118
| `lb_port` | String | Load balancer listening port. Defaults to 80 if NO FQDN provided, 443 if FQDN provided |
85
119
| `lb_healthcheck` | String | Load balancer health check string. Defaults to HTTP:app_port |
86
120
| `ec2_instance_profile` | String | The AWS IAM instance profile to use for the EC2 instance. Default is `${GITHUB_ORG_NAME}-${GITHUB_REPO_NAME}-${GITHUB_BRANCH_NAME}` |
87
121
| `ec2_instance_type` | String | The AWS IAM instance type to use. Default is t2.small. See [this list](https://aws.amazon.com/ec2/instance-types/) for reference |
88
-
| `stack_destroy` | String | Set to `true` to destroy the stack. Default is `""` - Will delete the tf_state_bucket after destroy. |
122
+
| `stack_destroy` | String | Set to `true` to destroy the stack. Default is `""` - Will delete the tf_state and elb_logs bucket after the destroy action runs. |
89
123
| `aws_resource_identifier` | String | Set to override the AWS resource identifier for the deployment. Defaults to `${org}-{repo}-{branch}`. Use with destroy to destroy specific resources. |
90
-
| `app_directory` | String | Relative path for the directory of the app (i.e. where `Dockerfile` and `docker-compose.yaml` files are located). This is the directory that is copied to the EC2 instance. Default is the root of the repo. |
124
+
| `app_directory` | String | Relative path for the directory of the app (i.e. where `Dockerfile` and `docker-compose.yaml` files are located). This is the directory that is copied to the EC2 instance. Default is the root of the repo. |
91
125
| `additional_tags` | JSON | Add additional tags to the terraform [default tags](https://www.hashicorp.com/blog/default-tags-in-the-terraform-aws-provider), any tags put here will be added to all provisioned resources.|
92
126
93
127
## Note about resource identifiers
@@ -101,7 +135,7 @@ For some specific resources, we have a 32 characters limit. If the identifier le
101
135
102
136
### S3 buckets naming
103
137
104
-
Buckets name can be made of up to 63 characters. If the length allows us to add -tf-state, we will do so. If not, a simple -tf will be added.
138
+
Buckets names can be made of up to 63 characters. If the length allows us to add -tf-state, we will do so. If not, a simple -tf will be added.
105
139
106
140
## Made with BitOps
107
141
[BitOps](https://bitops.sh) allows you to define Infrastructure-as-Code for multiple tools in a central place. This action uses a BitOps [Operations Repository](https://bitops.sh/operations-repo-structure/) to set up the necessary Terraform and Ansible to create infrastructure and deploy to it.
0 commit comments