Skip to content

Commit c58625b

Browse files
authored
add: config option for database class and logfile location (#2)
* add: config option for database class and logfile location * defaults
1 parent 1966ab1 commit c58625b

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ role.
1515
| `base_url` || | - | The `SS_BASE_URL` of the page |
1616
| `admin_username` || 🔐 | - | The username of the default admin |
1717
| `admin_password` || 🔐 | - | The Password of the default admin |
18+
| `database_class` | | | `MySQLPDODatabase` | The name of the database class to use |
1819
| `database_name` || | - | The name of the database to use |
1920
| `database_username` || 🔐 | - | The username to access the database |
2021
| `database_password` || 🔐 | - | The password to access the database |
@@ -24,6 +25,7 @@ role.
2425
| `htaccess_template` | | | `htaccess.public.j2` | Used to render a custom htaccess in the webroot. Path is relative to your repository root |
2526
| `project_repository` | | | `git@github.com:${{ github.repository }}.git` | Use a custom origin. This can be used to use custom configs for diffrent repositories. |
2627
| `composer_command` | | | - | Use a custom composer command instead of the installed one |
28+
| `error_log` | | | `../../../logs/ss_log.log` | The Location of the error log |
2729

2830
> This is an ongoing project, in the future we want to add more features of the [`ansible.silverstripe`](https://github.com/syntro-opensource/ansible.silverstripe) role.
2931

action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ inputs:
4040
current_dir:
4141
description: The name of the webroot.
4242
default: html
43+
database_class:
44+
description: 'The database class used by silverstripe'
45+
default: MySQLPDODatabase
4346
database_server:
4447
description: 'The database server'
4548
default: localhost
@@ -54,6 +57,9 @@ inputs:
5457
description: Manually set an origin repository. useful for using a host-specific ssh-config on the server with a deploy key.
5558
composer_command:
5659
description: Manually set the composer command
60+
error_log:
61+
description: 'The path to the error log'
62+
default: '../../../logs/ss_log.log'
5763
# retained_releases:
5864
# description: 'How many releases should be retained. useful if you need to rollback to an old release quickly.'
5965
# default: 4
@@ -86,6 +92,7 @@ runs:
8692
ACTIONENV_SS_ADMIN_PASSWORD: ${{ inputs.admin_password }}
8793
ACTIONENV_SS_DATABASE_SERVER: ${{ inputs.database_server }}
8894
ACTIONENV_SS_DATABASE_NAME: ${{ inputs.database_name }}
95+
ACTIONENV_SS_DATABASE_CLASS: ${{ inputs.database_class }}
8996
ACTIONENV_SS_DATABASE_USERNAME: ${{ inputs.database_username }}
9097
ACTIONENV_SS_DATABASE_PASSWORD: ${{ inputs.database_password }}
9198
ACTIONENV_HTACCESS_TEMPLATE: ${{ github.workspace }}/${{ inputs.htaccess_template }}
@@ -96,6 +103,7 @@ runs:
96103
ACTIONENV_PROJECT_VERSION: ${{ github.ref_name }}
97104
ACTIONENV_CURRENT_DIR: ${{ inputs.current_dir }}
98105
ACTIONENV_COMPOSER_COMMAND: ${{ inputs.composer_command }}
106+
ACTIONENV_SS_ERROR_LOG: ${{ inputs.error_log }}
99107
# ACTIONENV_RETAIN_RELEASES: ${{ inputs.retained_releases }}
100108
ANSIBLE_HOST_KEY_CHECKING: 'false'
101109
ANSIBLE_DEPRECATION_WARNINGS: 'false'

playbook/playbook.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
silverstripe_ss_database_username: "{{ lookup('env', 'ACTIONENV_SS_DATABASE_USERNAME') }}"
1717
silverstripe_ss_database_password: "{{ lookup('env', 'ACTIONENV_SS_DATABASE_PASSWORD') }}"
1818
# Optional Inputs
19+
silverstripe_ss_database_class: "{{ lookup('env', 'ACTIONENV_SS_DATABASE_CLASS') | default('MySQLPDODatabase', true) }}"
1920
silverstripe_retained_releases: 3
2021
silverstripe_htaccess_template: "{{ lookup('env', 'ACTIONENV_HTACCESS_TEMPLATE') }}"
2122
silverstripe_composer_command: "{{ lookup('env', 'ACTIONENV_COMPOSER_COMMAND') | default( silverstripe_working_dir + '/composer', true) }}"
23+
silverstripe_ss_error_log: "{{ lookup('env', 'ACTIONENV_SS_ERROR_LOG') | default('../../../logs/ss_log.log', true) }}"
2224
# silverstripe_composer_command: "{{ silverstripe_working_dir }}/composer"
2325
silverstripe_ss_environment_type: "{{ lookup('env', 'ACTIONENV_ENVIRONMENT_TYPE') | default('live', true) }}"
2426
silverstripe_current_dir_name: "{{ lookup('env', 'ACTIONENV_CURRENT_DIR') | default('html', true) }}"

0 commit comments

Comments
 (0)