Skip to content

Include dot folders #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ The following inputs can be used as `step.with` keys
| Name | Type | Description |
|------------------|---------|------------------------------------|
| `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. |
| `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. |
| `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). |
| `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`. |
| `app_port` | String | Port to be expose for the container. Default is `3000` |
<hr/>
Expand Down
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ inputs:
description: 'Set to true to run docker-compose down and docker system prune --all --force --volumes after.'
required: false
app_directory:
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.'
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.'
app_directory_cleanup:
description: 'Will generate a timestamped compressed file and delete the app repo directory.'
required: false
Expand Down
10 changes: 7 additions & 3 deletions operations/_scripts/generate/generate_app_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ mkdir -p "${GITHUB_ACTION_PATH}/operations/deployment/ansible/app/${GITHUB_REPO_

TARGET_PATH="$GITHUB_WORKSPACE"
if [ -n "$APP_DIRECTORY" ]; then
echo "APP_DIRECTORY: $APP_DIRECTORY"
TARGET_PATH="${TARGET_PATH}/${APP_DIRECTORY}"
echo "APP_DIRECTORY: $APP_DIRECTORY"
TARGET_PATH="${TARGET_PATH}/${APP_DIRECTORY}"
fi

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

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