Skip to content

Commit bdf682f

Browse files
authored
Merge branch 'main' into feature/drop_sidekiq
2 parents aa99b47 + 375d57b commit bdf682f

23 files changed

+130
-316
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ We want you to know exactly the reason behind each single step of this guide.
3939

4040
Thank you for your work and have fun! :tada:
4141

42+
## Serving the Documentation Locally
43+
44+
To view this documentation on your machine, run the following command:
45+
46+
```sh
47+
mbook serve
48+
```
49+
4250
## License
4351

4452
[Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/legalcode)

SUMMARY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
- [Sidekiq](ruby_on_rails/sidekiq.md)
4747
- [Cucumber](ruby_on_rails/cucumber.md)
4848
- [Amazon S3 and Cloudfront](ruby_on_rails/aws.md)
49-
- [Carrierwave Upload](ruby_on_rails/carrierwave.md)
5049
- [Bootstrap](ruby_on_rails/bootstrap.md)
5150
- [FontAwesome](ruby_on_rails/font_awesome.md)
5251
- [Bullet](ruby_on_rails/bullet.md)

configure_git_repository.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
1-
# Configure the Git Repository
1+
# Configure the GitHub Repository
22

33
These are the suggested configurations for our GitHub repositories.
44
Please stick to it unless you have special needs.
55

6-
* Options
6+
* General Settings
77
* Features: Remove *Wikis*, *Issues* and *Projects*
8-
* Merge button: Automatically delete head branches
9-
* Merge button: Remove *Allow merge commits* and *Allow rebase merging*
10-
* Merge button: Allow auto-merge
8+
* Pull Requests
9+
* Disable *Allow merge commits* and *Allow rebase merging*
10+
* Allow auto-merge
11+
* Automatically delete head branches
12+
* Always suggest updating pull request branches
1113
* Manage access
1214
* Add *staff* team as a collaborator with Admin access
1315
* Add *security* team as collaborator with Write access
1416
* Branches
15-
* Default branch: `develop`. Click *update*
16-
* Add these rules for the two branches `develop` and `main`:
17-
* Require pull request reviews before merging
18-
* Require status checks to pass before merging (after you configured the CI add it to the required checks)
19-
* Always suggest updating pull request branches
17+
* Default branch: either `main` or `develop` depending on whether you want one or two environments.
18+
* Rules/Rulesets
19+
* `develop`
20+
* Enforcement status: `Active`
21+
* Branch targeting criteria: `develop`
22+
* Bypass list: add `Repository Admin` Role with *allow for pull requests only* option
23+
* Restrict deletions
24+
* Require linear history
25+
* Require a pull request before merging
26+
* Require status checks to pass
27+
* Select `ci/semaphore/push`
28+
* Block force pushes
29+
* `main` (same as develop but...)
30+
* Branch targeting criteria: `main`
31+
* ❌ Require a pull request before merging
32+
* ❌ Require status checks to pass
2033

2134
* Autolink references
2235
* Add a new Autolink reference with:

create_git_repository.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ Use the command `hub create -p renuo/[project-name]` to create the repo and add
1212

1313
## Public repos need a license
1414

15-
If your repository is public, ensure that it contains a license. We usually use the [MIT](https://choosealicense.com/licenses/mit/) license if possible or a [CreativeCommons](https://creativecommons.org/licenses/) license for documentation-only repositories (such as the application setup guide 🙂).
15+
If your repository is public, ensure that it contains a license.
16+
We usually use the [MIT](https://choosealicense.com/licenses/mit/) license if possible or a [CreativeCommons](https://creativecommons.org/licenses/) license for documentation-only repositories (such as the application setup guide 🙂).
1617
You can add a license directly on GitHub while initializing a repository by selecting a license template in the "Add a license" dropdown.
1718
However, if the repository is already initialized, you're still able to add a license using a template:
1819
* Click `Create new file`

go_live.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,24 @@ This is done via page rules in Cloudflare.
2525
1. Enter `https://www.example.com/$1`
2626
1. Click "Save and Deploy"
2727

28+
## Deploio (Preferred Deployment Method)
29+
30+
We now recommend deploying applications using [Deploio](https://deplo.io), moving away from Heroku.
31+
32+
When preparing your app for production on Deploio, ensure the following:
33+
34+
* Verify the machine type of the PostgreSQL database in the PostgreSQL resource view.
35+
* Confirm the configured application size in the application configuration tab.
36+
* Ensure the application replica count is correctly set in the application configuration tab.
37+
38+
For detailed instructions and best practices, including quick start guides for a variety of frameworks, please refer to the [Deploio deployment documentation](https://docs.deplo.io/documentation/networking_and_deployment/).
39+
2840
## Heroku
2941

3042
* Check the size and amount of dynos on Heroku
3143
* Check the database size plan on Heroku and upgrade if it is foreseeable that 10'000 rows are exceeded in a short time
3244
* Check additional addons and according plans on Heroku
3345

34-
## Deploio
35-
36-
* Verify the machine type of the PostgreSQL database in the PostgreSQL resource view
37-
* Confirm the configured application size in the application configuration tab
38-
* Ensure the application replica count is correctly set in the application configuration tab
39-
4046
## Other
4147

4248
* Reset admin credentials, seeds, ... if necessary

ruby_on_rails/README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ This setup will cover a pure, monolithic Rails Applications.
44
This is the most frequent type of application we have at [Renuo](https://renuo.ch) and is probably also the easiest to setup.
55
The application (and relative GitHub repo) will be named after the `[project-name]` you chose before.
66

7-
Have you chosen a `[project-name]` yet? If not, please do so now. Check our [Naming Conventions](../naming_conventions.md)
7+
> [!NOTE]
8+
> Have you chosen a `[project-name]` yet? If not, please do so now. Check our [Naming Conventions](../naming_conventions.md)
9+
10+
> [!NOTE]
11+
> Have you decided if you need two environments (develop and main) or just one?
12+
> As a rule of thumb: for customers we always use two environments, for internal projects we usually only use one.
13+
> Why the difference? Because we can bare the risk of having a bug in an internal project, but we cannot do that for a customer.
14+
815
1. [Initialise the Rails Application](app_initialisation.md)
916
1. [Push to Git Repository](first_git_push.md)
1017
1. [Initialise Gitflow](initialise_gitflow.md)
1118
1. [Configure Git Repository](../configure_git_repository.md)
12-
1. [Create an Application Server for Heroku](create_application_server_heroku.md)
13-
1. [Create an Application Server for Deploio](create_application_server_deploio.md)
19+
1. [Create an Application Server for Deploio](create_application_server_deploio.md) or [Create an Application Server for Heroku](create_application_server_heroku.md)
1420
1. [Configure the CI / CD](configure_ci.md)
1521

16-
Once here, your app should be up and running on all three environments.
22+
Once here, your app should be up and running on all environments.
1723

1824
It's now time to introduce some more tools which will help you and the team to keep a high quality during the project development.
1925

@@ -56,14 +62,12 @@ useful services:
5662
1. [Devise](devise.md)
5763
1. [Cucumber](cucumber.md)
5864
1. [Amazon S3 and Cloudfront](aws.md)
59-
1. [Carrierwave Upload](carrierwave.md)
6065
1. awesome_print `gem 'awesome_print'`
6166
1. [bootstrap](bootstrap.md)
6267
1. [font-awesome](font_awesome.md)
6368
1. [bullet](bullet.md) `gem 'bullet'`
6469
1. [lograge](appsignal.md) `gem 'lograge'`
6570
1. Rack Tracker (Google Analytics) `gem 'rack-tracker'` --> see [Google Analytics](../google_analytics.md)
66-
1. [Typescript](https://github.com/typescript-ruby/typescript-rails)
6771
1. Favicons
6872
1. [Rack CORS](https://github.com/cyu/rack-cors)
6973
1. [Rack Attack](https://github.com/rack/rack-attack#installing)

ruby_on_rails/app_initialisation.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,32 +65,29 @@ Some other adjustments must be performed manually.
6565

6666
Please perform these adjustments manually:
6767

68-
#### ENV variables with Figaro
68+
#### ENV variables
6969

70-
* Add `figaro` to Gemfile. Check the [gem homepage](https://github.com/laserlemon/figaro) to see how to install the gem
71-
(usually `bundle exec figaro install` is enough). Delete the newly created file `config/application.yml`...
72-
* and create `config/application.example.yml` where you will specify the only environment variable you need for now:
70+
* Add `dotenv-rails` to Gemfile. Check the [gem homepage](https://github.com/bkeepers/dotenv) to see how to install the gem.
71+
* and create `.env.example` in the root folder of the project where you will specify the only environment variable you need for now:
7372
`SECRET_KEY_BASE`.
74-
* Going forward we will only push the `config/application.example.yml` file to the repository in order to protect our env variables.
75-
* Add application.yml to .gitignore
76-
* Add the following section to your `bin/setup` script so that the `application.yml` is created from the `application.example.yml` when the project is setup locally:
73+
* Going forward we will only push the `.env.example` file to the repository in order to protect our env variables.
74+
* Add .env to .gitignore
75+
* Add the following section to your `bin/setup` script so that the `.env` is created from the `.env` when the project is setup locally:
7776

7877
```ruby
7978
puts "\n== Copying sample files =="
80-
unless File.exist?('config/application.yml')
81-
system! 'cp config/application.example.yml config/application.yml'
79+
unless File.exist?('.env')
80+
system! 'cp .env.example .env'
8281
end
8382
```
8483

85-
* add one more key to application.example.yml `APP_PORT: 3000`
84+
* add one more key to .env.example `APP_PORT=3000`
85+
* To ensure you have all the required keys from the `.env.example` in your `.env`,
86+
create the initializer for dotenv-rails in `config/initializers/dotenv_rails.rb`:
8687

87-
Make sure it comes **before** any `rails` comands.
88-
* To ensure you have all the required keys from the `application.example.yml` in your `application.yml`,
89-
create the initializer for figaro in `config/initializers/figaro.rb`:
90-
91-
```ruby
92-
Figaro.require_keys(YAML.load_file('config/application.example.yml').keys - %w[test production development])
93-
```
88+
```ruby
89+
Dotenv.require_keys(Dotenv.parse(".env.example").keys)
90+
```
9491

9592
* Run `bin/setup` again.
9693

0 commit comments

Comments
 (0)