Skip to content

Commit 2566696

Browse files
Include dot folders (#125)
* Changing cp for rsync, adding .ignore support * Updating README * Fixing rsync paths * Changing .ignore name to .gha-ignore * Adding glob patterns detail --------- Co-authored-by: Mick McGrath Co-authored-by: LeoDiazL
1 parent 4bccfd0 commit 2566696

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ The following inputs can be used as `step.with` keys
223223
| Name | Type | Description |
224224
|------------------|---------|------------------------------------|
225225
| `docker_full_cleanup` | Boolean | Set to `true` to run `docker-compose down` and `docker system prune --all --force --volumes` after. Runs before `docker_install`. WARNING: docker volumes will be destroyed. |
226-
| `app_directory` | String | Relative path for the directory of the app. (i.e. where the `docker-compose.yaml` file is located). This is the directory that is copied into the EC2 instance. Default is `/`, the root of the repository. |
226+
| `app_directory` | String | Relative path for the directory of the app. (i.e. where the `docker-compose.yaml` file is located). This is the directory that is copied into the EC2 instance. Default is `/`, the root of the repository. Add a `.gha-ignore` file with a list of files to be exluded. (Using glob patterns). |
227227
| `app_directory_cleanup` | Boolean | Will generate a timestamped compressed file (in the home directory of the instance) and delete the app repo directory. Runs before `docker_install` and after `docker_full_cleanup`. |
228228
| `app_port` | String | Port to be expose for the container. Default is `3000` |
229229
<hr/>

action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ inputs:
5858
description: 'Set to true to run docker-compose down and docker system prune --all --force --volumes after.'
5959
required: false
6060
app_directory:
61-
description: '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.'
61+
description: '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. Add a .gha-ignore file with a list of files to be exluded.'
6262
app_directory_cleanup:
6363
description: 'Will generate a timestamped compressed file and delete the app repo directory.'
6464
required: false

operations/_scripts/generate/generate_app_repo.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ mkdir -p "${GITHUB_ACTION_PATH}/operations/deployment/ansible/app/${GITHUB_REPO_
1111

1212
TARGET_PATH="$GITHUB_WORKSPACE"
1313
if [ -n "$APP_DIRECTORY" ]; then
14-
echo "APP_DIRECTORY: $APP_DIRECTORY"
15-
TARGET_PATH="${TARGET_PATH}/${APP_DIRECTORY}"
14+
echo "APP_DIRECTORY: $APP_DIRECTORY"
15+
TARGET_PATH="${TARGET_PATH}/${APP_DIRECTORY}"
1616
fi
1717

18-
cp -rf "$TARGET_PATH"/* "${GITHUB_ACTION_PATH}/operations/deployment/ansible/app/${GITHUB_REPO_NAME}/"
18+
if [ -f "$TARGET_PATH/.gha-ignore" ]; then
19+
rsync -a --exclude-from="$TARGET_PATH/.gha-gnore" "$TARGET_PATH"/ "${GITHUB_ACTION_PATH}/operations/deployment/ansible/app/${GITHUB_REPO_NAME}/"
20+
else
21+
rsync -a "$TARGET_PATH"/ "${GITHUB_ACTION_PATH}/operations/deployment/ansible/app/${GITHUB_REPO_NAME}/"
22+
fi
1923

2024
if [ -s "$TARGET_PATH/$REPO_ENV" ]; then
2125
echo "Copying checked in env file from repo to Ansible deployment path"

0 commit comments

Comments
 (0)