|
1 | 1 | # Wunder template for Drupal projects |
2 | 2 |
|
3 | | -This project template is an opinionated fork of the popular [drupal-omposer template](https://github.com/drupal-composer/drupal-project), configured to automatically deploy code to a [Kubernetes](https://kubernetes.io/) cluster using [CircleCI](https://circleci.com/). |
| 3 | +This project is a tailored fork of the popular [drupal-composer template](https://github.com/drupal-composer/drupal-project). It is designed for deploying to [Kubernetes](https://kubernetes.io/) clusters via [CircleCI](https://circleci.com/). |
4 | 4 |
|
5 | 5 | ## Getting started |
6 | 6 |
|
7 | | -1. Click "[Use this template](https://github.com/wunderio/drupal-project/generate)" to generate a new project: |
| 7 | +1. **Create a new project repository** |
| 8 | + Click "[Use this template](https://github.com/wunderio/drupal-project/generate)" to generate a new project: |
8 | 9 | - Select the correct owner. |
9 | 10 | - Name the project as `client-COUNTRYCODE-CLIENT-PROJECT`. |
10 | | - - Make the repository private (unless the project is public). |
11 | | -2. Clone the new project locally and update its details: |
| 11 | + - Set the repository to private (unless the project is public). |
| 12 | + |
| 13 | +2. **Clone and customize the repository** |
| 14 | + Clone the new project locally and update its details: |
| 15 | + - Update `README.md` with the project details. |
12 | 16 | - Update `composer.json` with the project name. |
13 | | - - Modify the `silta/silta.yml` [values](https://github.com/wunderio/charts/blob/master/drupal/values.yaml). |
14 | | - - Adjust `grumphp.yml` tasks, including the project name in the `git_commit_message` regex. |
15 | | -3. Log in to [CircleCI](https://app.circleci.com/) using your GitHub account and add the new project using the existing configuration. |
16 | | -4. Configure [automatic autolinks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls#custom-autolinks-to-external-resources) for the project's JIRA environment. |
| 17 | + - Modify the `silta/silta*` files [values](https://github.com/wunderio/charts/blob/master/drupal/values.yaml). |
| 18 | + - Adjust `grumphp.yml` tasks, including updating the project name in the `git_commit_message` regex. |
| 19 | + - Adjust the `lando` configuration in `.lando.yml`. |
| 20 | + |
| 21 | +3. **Set up CircleCI** |
| 22 | + - Log in to [CircleCI](https://app.circleci.com/) using your GitHub account. |
| 23 | + - Add the new project to CircleCI using the existing configuration. |
| 24 | + |
| 25 | +4. **Configure encryption keys and secrets** |
| 26 | + - Define encryption keys for `silta_dev` and `silta_finland` contexts in the CircleCI project settings and backup the keys in LastPass. Use the following naming convention: `SEC_{PROJECT_NAME}_{CONTEXT}` where `CONTEXT` is the environment, such as `silta_dev` or `silta_finland`. |
| 27 | + - Update the `.circleci/config.yml` file with the corresponding `secret_key_env` values. |
| 28 | + - Define the secret environment variables in the `silta/silta*.secrets` YAML files for the `silta_dev` and `silta_finland` contexts. |
| 29 | + - Encrypt the `silta/silta*.secrets` files using the encryption keys and commit the encrypted files to the repository. |
| 30 | + - See the relevant [Silta's documentation](https://wunderio.github.io/silta/docs/encrypting-sensitive-configuration/#using-a-custom-encryption-key) for details. |
| 31 | + |
| 32 | +5. **Enable JIRA integration** |
| 33 | + - Configure [automatic autolinks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls#custom-autolinks-to-external-resources) for the project's JIRA environment to link ticket IDs to JIRA issues seamlessly. |
17 | 34 |
|
18 | 35 | For additional instructions, please refer to the [Silta documentation](https://github.com/wunderio/silta). |
19 | 36 |
|
@@ -84,9 +101,9 @@ The following secret variables are defined in the `silta/silta.secrets` file for |
84 | 101 | - **`lando varnishadm <commands>`**: Run [varnishadm](https://varnish-cache.org/docs/6.0/reference/varnishadm.html) commands. |
85 | 102 | - **`lando xdebug <mode>`**: Load [Xdebug](https://xdebug.org/) in the selected [mode(s)](https://xdebug.org/docs/all_settings#mode). |
86 | 103 |
|
87 | | -## Development advice |
| 104 | +## Development tips |
88 | 105 |
|
89 | | -### Drupal core tips |
| 106 | +### Drupal core updates |
90 | 107 |
|
91 | 108 | - [Updating Drupal core](https://www.drupal.org/docs/updating-drupal/updating-drupal-core-via-composer). |
92 | 109 | - [Altering scaffold files](https://www.drupal.org/docs/develop/using-composer/using-drupals-composer-scaffold#toc_4) (e.g., `robots.txt`, `.htaccess`). |
@@ -148,28 +165,19 @@ Use `lando phpunit` to run PHPUnit commands: |
148 | 165 |
|
149 | 166 | [Silta CLI](https://github.com/wunderio/silta-cli) is a command-line tool to manage secrets and configurations for Silta projects. Use the following commands: |
150 | 167 |
|
151 | | -- Encrypt a file: `silta secrets encrypt --file silta/silta.secret --secret-key=$SECRET_KEY` |
152 | | -- Decrypt a file: `silta secrets decrypt --file silta/silta.secret --secret-key=$SECRET_KEY` |
| 168 | +- Encrypt a file: `silta secrets encrypt --file silta/silta.secrets --secret-key=<secret_key_env>` |
| 169 | +- Decrypt a file: `silta secrets decrypt --file silta/silta.secrets --secret-key=<secret_key_env>` |
153 | 170 | - Display help: `silta secrets --help` |
154 | 171 |
|
155 | | -You need a secret key to encrypt and decrypt data. It can be specified with the `--secret-key` flag (defaults to the `SECRET_KEY` environment variable). To enhance security, use a custom key for each project. See [Silta's documentation](https://wunderio.github.io/silta/docs/encrypting-sensitive-configuration/#using-a-custom-encryption-key) for details. |
156 | | -
|
157 | | -#### Key naming convention |
158 | | -
|
159 | | -Use the following naming convention for custom keys: `SEC_{PROJECT_NAME}_{CONTEXT}` where `CONTEXT` is the environment, such as `silta_dev` or `silta_finland`. |
160 | | -For example, for the `drupal-project` in the `silta_dev` environment, use the key: `SEC_DRUPAL_PROJECT_SILTA_DEV`. |
161 | | -
|
162 | | -#### Secrets file |
163 | | -
|
164 | | -The `silta/silta.secret` file is a YAML file containing encrypted secrets for the `silta-dev` context. Add additional files for other contexts, such as `silta/silta-prod.secret` for production. |
| 172 | +See the corresponding `secret_key_env` values in the `.circleci/config.yml` file for the `silta_dev` and `silta_finland` contexts. Refer to the Getting Started section for details. |
165 | 173 |
|
166 | 174 | ## Contributing |
167 | 175 |
|
168 | 176 | This project is maintained by [Wunder](https://wunder.io/). Contributions from the community are welcome. |
169 | 177 |
|
170 | | -### Commit Message Validation and Ticketing System Integration |
| 178 | +### Commit message validation and ticketing system integration |
171 | 179 |
|
172 | | -We use JIRA and GitHub Issues for tracking tasks. Commit messages must include a valid ticket ID except for merge commits. Use the following format: |
| 180 | +We use JIRA and GitHub issues for tracking tasks. Commit messages must include a valid ticket ID except for merge commits. Use the following format: |
173 | 181 |
|
174 | 182 | - JIRA: `[PROJECTKEY-123]: Description` |
175 | 183 | - GitHub: `[GH-123]: Description` |
|
0 commit comments