diff --git a/README.md b/README.md index cf399d09..34322baf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Renuo Application Setup Guide -This repo is the [Renuo](https://www.renuo.ch) collection of best-practices to set-up apps. +This repo is the [Renuo](https://www.renuo.ch) collection of best-practices to set up apps. We are a [Rails company](https://rubyonrails.org/foundation), so the most value probably will be found in the parts concerning Rails. But anyways you'll also find a lot about the inner workings of Renuo. @@ -15,10 +15,11 @@ This guide is the result of more than ten years of experience, so this means thr **You are always welcome to challenge the guide and improve it with a Pull Request.** -**:exclamation: Do not blindly follow this guide, always think about what you are doing and why. -If you think something is wrong or simply outdated, improve this guide with a Pull Request.** +> [!IMPORTANT] +> Do not blindly follow this guide, always think about what you are doing and why. +> If you think something is wrong or simply outdated, improve this guide with a Pull Request. -Thank you for your work and have fun! :tada: +Thank you for your work and have fun! 🎉 ## How to Use This Guide @@ -33,13 +34,13 @@ The guide is structured as a linear walkthrough. Follow it from top to bottom wh Before the team can start working on a project, you need: -* An existing *git* repository containing the project +* A git repository containing the project * Two branches: *main* and *develop* (or just *main* for internal projects) * A README with essential information about the application -* Convenience-scripts: `bin/setup`, `bin/check`, `bin/fastcheck`, `bin/run` +* Convenience scripts: `bin/setup`, `bin/check`, `bin/fastcheck`, `bin/run` * One running, green test -* Continuous integration (*CI*) ready, running and green for all branches -* Continuous deployment (*CD*) ready and running for all branches +* CI ready, running and green for all branches +* CD ready and running for all branches * The application deployed for all branches ## Serving the Documentation Locally diff --git a/SUMMARY.md b/SUMMARY.md index d2fa93da..13454ff7 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -50,7 +50,6 @@ - [FontAwesome](ruby_on_rails/font_awesome.md) - [Bullet](ruby_on_rails/bullet.md) - [Hotjar](ruby_on_rails/hotjar.md) -- [Wicked PDF](ruby_on_rails/wicked_pdf.md) - [Recaptcha v3](ruby_on_rails/recaptcha.md) - [Wallee Payment](ruby_on_rails/wallee.md) - [Content Security Policy](ruby_on_rails/content_security_policy.md) diff --git a/configure_github_repository.md b/configure_github_repository.md index e9af177f..06b689da 100644 --- a/configure_github_repository.md +++ b/configure_github_repository.md @@ -16,9 +16,12 @@ Please stick to it unless you have special needs. * Branches * Default branch: either `main` or `develop` depending on whether you want one or two environments. * Rules/Rulesets - * `develop` + * We use two rulesets: one for `main` and one for everything else. This ensures that long-lived branches like `redesign` and feature branches like `feat/my-feature` share the same protection rules as `develop`. + * `non-main` * Enforcement status: `Active` - * Branch targeting criteria: `develop` + * Branch targeting criteria: + * Include all branches + * Exclude by pattern: `main` * Bypass list: add `Repository Admin` Role with *allow for pull requests only* option * Restrict deletions * Require linear history @@ -26,19 +29,15 @@ Please stick to it unless you have special needs. * Require status checks to pass * Select `ci/semaphore/push` * Block force pushes - * `main` (same as develop but...) + * `main` (same as non-main but...) * Branch targeting criteria: `main` * ❌ Require a pull request before merging * ❌ Require status checks to pass - * Autolink references * Add a new Autolink reference with: * Reference prefix: `TICKET-` * Target URL: `https://redmine.renuo.ch/issues/` -In case you have a second long-living environment (e.g., for a design rewrite, a new major version, etc.), -consider applying the same rules as on `develop` to it as well. - ## Team Each project has a team owning it. The team is named after the project: `[team-name] = [project-name]`. diff --git a/google_analytics.md b/google_analytics.md index 1a30b7d8..8cb2c802 100644 --- a/google_analytics.md +++ b/google_analytics.md @@ -33,7 +33,8 @@ script which you can find [here](https://developers.google.com/analytics/devguid Make sure you insert this script at the end of the `` tag of the page (not in the ``). -NOTE: There is a default IP anonymization feature in GA4. We no longer need to perform this step manually. +> [!NOTE] +> There is a default IP anonymization feature in GA4. We no longer need to perform this step manually. ## b) Ruby rack-tracker diff --git a/naming_conventions.md b/naming_conventions.md index 26fd5cc0..b2f64ee2 100644 --- a/naming_conventions.md +++ b/naming_conventions.md @@ -18,7 +18,8 @@ asked to do the same. * Use `[project-name]-[purpose]-[branch]` for deployed projects (e.g. one11-web-main). * Use `[project-name]-local-[user]-[rails_env]` for local names which interact with online services (e.g. S3). -**Note:** Previously on Heroku, the convention was to use `[project-name]-[branch]-[purpose]` for deployed projects (e.g. kingschair-main-assets). This has been updated due to deplo.io. +> [!NOTE] +> Previously on Heroku, the convention was to use `[project-name]-[branch]-[purpose]` for deployed projects (e.g. kingschair-main-assets). This has been updated due to deplo.io. ## Examples @@ -32,13 +33,13 @@ asked to do the same. The naming conventions should be applied everywhere. Some examples: -* Amazon S3 (usually [project-name]-[branch]) -* Github ([project-name]) -* Heroku ([project-name]-[branch]) -* Redmine ([project-name]) -* Semaphore CI (servers are named [project-name]-[branch]) -* Drive ([project-name]) -* New Relic ([project-name]-[branch]) +* Amazon S3 (usually `[project-name]-[branch]`) +* Github (`[project-name]`) +* Heroku (`[project-name]-[branch]`) +* Redmine (`[project-name]`) +* Semaphore CI (servers are named `[project-name]-[branch]`) +* Drive (`[project-name]`) +* New Relic (`[project-name]-[branch]`) * Get Sentry * App name in Rails * Sparkpost Account diff --git a/ruby_on_rails/README.md b/ruby_on_rails/README.md index c2c5121e..9eeca498 100644 --- a/ruby_on_rails/README.md +++ b/ruby_on_rails/README.md @@ -1,8 +1,8 @@ # Ruby On Rails - Application Setup Guide -This setup will cover a pure, monolithic Rails Applications. -This is the most frequent type of application we have at [Renuo](https://renuo.ch) and is probably also the easiest to setup. -The application (and relative GitHub repo) will be named after the `[project-name]` you chose before. +This setup covers a pure, monolithic Rails application. +This is the most frequent type of application at [Renuo](https://renuo.ch) and is probably the easiest to set up. +The application (and its GitHub repo) will be named after the `[project-name]` you chose before. > [!NOTE] > Have you chosen a `[project-name]` yet? If not, please do so now. Check our [Naming Conventions](../naming_conventions.md) @@ -10,10 +10,11 @@ The application (and relative GitHub repo) will be named after the `[project-nam > [!NOTE] > Have you decided if you need two environments (develop and main) or just one? > As a rule of thumb: for customers we always use two environments, for internal projects we usually only use one. -> 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. +> Why the difference? Because we can bear the risk of having a bug in an internal project, but we cannot do that for a customer. > Decide with your team if you want one or two branches. -> :bulb: **Tip:** Sections marked with ✨ are already set up by the Renuo Rails template or ship with Rails 8.1 by default. You only need to verify them, not install them. +> [!TIP] +> Sections marked with ✨ are already set up by the Renuo Rails template or ship with Rails 8.1 by default. You only need to verify them, not install them. --- @@ -22,30 +23,29 @@ The application (and relative GitHub repo) will be named after the `[project-nam 1. [Initialise the Rails Application](app_initialisation.md) 1. [Push to Git Repository](first_git_push.md) 1. [Initialise Gitflow](initialise_gitflow.md) -1. [Configure Github Repository](../configure_github_repository.md) +1. [Configure GitHub Repository](../configure_github_repository.md) ## Step 2: Deploy the App 1. [Create an Application Server for Deploio](create_application_server_deploio.md) or [Create an Application Server for Heroku](create_application_server_heroku.md) -1. [Configure the CI / CD](configure_ci.md) +1. [Configure the CI/CD](configure_ci.md) -Once here, your app should be up and running on all environments. +Your app should now be up and running on all environments. ## Step 3: Quality Tools -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. +Set up the tools that help your team maintain high quality throughout development. 1. [RSpec](rspec.md) 1. [Linting and automatic checks](linting_and_automatic_check.md) -1. [Gems and libraries :gem:](suggested_libraries.md) +1. [Gems and libraries 💎](suggested_libraries.md) 1. [Cloudflare](cloudflare.md) -:tada: Finally you are ready to start working on you new project! :tada: +Your team can now start working on the project. ## Step 4: Monitoring & Protection -While everyone starts working there are some more things which you should setup. -Most are not optional, but the rest of the team can start working even if those are not in place yet. +Set these up while the rest of the team starts working. Most are not optional, but they don't block other work. 1. [AppSignal](appsignal.md) 1. [Sentry](sentry.md) (optional) @@ -69,7 +69,7 @@ Bookmark the project on [Redmine](https://dashboard.renuo.ch/redmine_projects) a The following are not part of the sequential setup. Use them as needed for your project. -* [Run Javascript tests with Jest](jest.md) +* [Run JavaScript tests with Jest](jest.md) * [Pull Requests Template](../templates/pull_requests_template.md) * [Slack and Project Notifications](../slack_and_notifications.md) * [Send emails](send_emails.md) @@ -78,18 +78,17 @@ The following are not part of the sequential setup. Use them as needed for your * [Cucumber](cucumber.md) * [Object storage](object_storage.md) * awesome_print `gem 'awesome_print'` -* [bootstrap](bootstrap.md) -* [font-awesome](font_awesome.md) -* [bullet](bullet.md) `gem 'bullet'` -* [lograge](appsignal.md#lograge) `gem 'lograge'` -* Rack Tracker (Google Analytics) `gem 'rack-tracker'` --> see [Google Analytics](../google_analytics.md) +* [Bootstrap](bootstrap.md) +* [FontAwesome](font_awesome.md) +* [Bullet](bullet.md) `gem 'bullet'` +* [Lograge](appsignal.md#lograge) `gem 'lograge'` +* Rack Tracker (Google Analytics) `gem 'rack-tracker'` → see [Google Analytics](../google_analytics.md) * Favicons * [Rack CORS](https://github.com/cyu/rack-cors) * [Rack Attack](https://github.com/rack/rack-attack#installing) -* [:fire: Hotjar](hotjar.md) +* [🔥 Hotjar](hotjar.md) * SEO * redirect non-www to www * Header tags -* [wicked pdf](wicked_pdf.md) `gem wicked_pdf` * [Recaptcha v3](recaptcha.md) * [Wallee Payment Integration](wallee.md) diff --git a/ruby_on_rails/app_initialisation.md b/ruby_on_rails/app_initialisation.md index 44675192..1195c2e8 100644 --- a/ruby_on_rails/app_initialisation.md +++ b/ruby_on_rails/app_initialisation.md @@ -18,20 +18,25 @@ rails new [project-name] --database=postgresql --skip-kamal --skip-ci --skip-act ``` where the `project-name` is exactly the one you chose before. -> ⚠️ You may want to choose a different database than Postgres, but most of the time this will be your choice.\ +> [!WARNING] +> You may want to choose a different database than Postgres, but most of the time this will be your choice. > You might also need actionmailbox of course, so always double-check the parameters that you are using. -> ⭐️ This setup does not include either js-bundling nor css-bundling by default.\ -> It will start with the simplest possible Rails setup and will use sprockets and importmaps.\ -> If you need to do fancy stuff, discuss with your team the opportunity of including a js-bundling and css-bundling tool.\ +> [!TIP] +> ⭐️ This setup does not include either js-bundling nor css-bundling by default. +> +> It will start with the simplest possible Rails setup and will use sprockets and importmaps. +> +> If you need to do fancy stuff, discuss with your team the opportunity of including a js-bundling and css-bundling tool. +> > We want to go ["no build"](https://www.youtube.com/watch?v=iqXjGiQ_D-A) whenever possible. * Run `bundle exec rails db:migrate` to generate an empty `schema.rb` file. * Run `bin/setup` -* Then check your default Rails setup by running `bin/run` and visiting http://[project-name].localhost:3000. +* Then check your default Rails setup by running `bin/run` and visiting `[project-name].localhost:3000`. You should be on Rails now, yay! -* Finally check if http://localhost:3000/up is green. +* Finally check if [http://localhost:3000/up](http://localhost:3000/up) is green. ## Adjustments @@ -40,27 +45,15 @@ Some other adjustments must be performed manually. ### Automatic adjustments -> ⭐️The `config/database.yml` is updated to have a `collation: C.UTF-8` setting. -> This ensures deterministic, locale-independent sorting and avoids inconsistencies between local and production -> environments. +⭐️ This setup includes the following automatic adjustments: -> ⭐The Gemfile reads the required ruby version from the `.ruby-version` file. -> [This is used by Heroku to determine what version to use.](https://devcenter.heroku.com/articles/ruby-versions) -> Deploio reads the ruby version from the Gemfile, with the .ruby-version file inlined into it. https://paketo.io/docs/howto/ruby/#override-the-detected-ruby-version - -> ⭐️renuocop replaces the default rubocop-rails-omakase. We have our own set of rules at Renuo. -> You can discuss them at https://github.com/renuo/renuocop and you can also contribute to them. - -> ⭐️a bin/check script is added to the project. This script will run all the tests of the project. -> It is used in our CI and can be used locally to check if everything is fine. You can customize it to your needs. - -> ⭐️a bin/fastcheck script is added to the project. -> This script will run all the linters of the project. It is used in our CI and can be customized to your needs. -> It will be used as a hook before pushing to quickly check for linting issues. - -> ⭐️a bin/run script is added to the project. This script will start the application. - -> ⭐️bin/check, bin/fastcheck and bin/run are standardized tools for more convenience at Renuo. +* `config/database.yml` uses `collation: C.UTF-8` for deterministic, locale-independent sorting across local and production environments. +* The Gemfile reads the required Ruby version from `.ruby-version`. [Heroku uses this to determine the Ruby version](https://devcenter.heroku.com/articles/ruby-versions); Deploio reads the version from the Gemfile. +* Renuocop replaces `rubocop-rails-omakase` with Renuo's rules. You can discuss or contribute to them at . +* `bin/check` runs the project tests and is used in CI. +* `bin/fastcheck` runs linters in CI and before pushing. +* `bin/run` starts the application. +* `bin/check`, `bin/fastcheck`, and `bin/run` are standardized Renuo convenience tools. ### Secrets diff --git a/ruby_on_rails/configure_ci.md b/ruby_on_rails/configure_ci.md index b3e34778..65ec7c10 100644 --- a/ruby_on_rails/configure_ci.md +++ b/ruby_on_rails/configure_ci.md @@ -4,13 +4,14 @@ At Renuo we **always** use a CI (Continuous Integration) system to test our appl that all the tests pass before building and releasing a new version through our CD system. Our projects use [SemaphoreCI](). -ℹ️ _Are you using **Gitlab**? Have a look at [this example](./gitlab_capybara_selenium.md) instead (and elaborate)._ +> [!NOTE] +> Are you using **Gitlab**? Have a look at [this example](./gitlab_capybara_selenium.md) instead (and elaborate). Before configuring the CI, you should already have a Git Repository with the code, a `bin/check` command to execute, and the main branches already pushed and ready to be tested. 1. Proceed to and login through GitHub with renuobot@renuo.ch ([1Password](https://start.1password.com/open/i?a=QZNJJCCDWVCGBGI73Z2L55KSGE&v=crlutt26yprmp6thr573qxsxkq&i=u7rirvnrf5fjxd25caiq7ib6vq&h=renuo.1password.com)) -1. Follow these instructions to install semaphore CLI https://docs.semaphoreci.com/reference/sem-command-line-tool/ +1. Follow these instructions to install semaphore CLI: 1. Create a project here: 1. Go to the project's artifact settings: `Settings` > `Artifacts` 1. Set the retention policy for project, workflow and job artifacts to `/**/*` and `2 weeks` diff --git a/ruby_on_rails/content_security_policy.md b/ruby_on_rails/content_security_policy.md index 5b07ee31..ee106c46 100644 --- a/ruby_on_rails/content_security_policy.md +++ b/ruby_on_rails/content_security_policy.md @@ -85,7 +85,7 @@ Starting from Rails 6 on, the `javascript_tag` view helper also accepts a nonce | img-src | `https://www.google-analytics.com` | | connect-src | `https://www.google-analytics.com` | -For a more details list, see https://developers.google.com/tag-manager/web/csp +For a more details list, see . ### Facebook Tracking Pixel diff --git a/ruby_on_rails/create_application_server_deploio.md b/ruby_on_rails/create_application_server_deploio.md index a81de2b1..d9c5db77 100644 --- a/ruby_on_rails/create_application_server_deploio.md +++ b/ruby_on_rails/create_application_server_deploio.md @@ -4,8 +4,8 @@ - You've [read about what Deploio is](https://docs.nine.ch/docs/deplo-io/getting-started-with-deploio). - You have a Deploio account. -- You have installed the `renuo-cli` gem. -- You have installed the `nctl` command. +- You have installed the [`renuo-cli`](https://github.com/renuo/renuo-cli) gem. +- You have installed the [`nctl`](https://github.com/ninech/nctl) command. - You have logged in using `nctl`. ## Setup @@ -16,7 +16,10 @@ Run [the command to generate a script](https://github.com/renuo/renuo-cli/blob/m renuo create-deploio-app [project-name] [git-url] ``` -e.g. `renuo create-deploio-app my-app git@github.com:renuo/my-app.git` +e.g: +```sh +renuo create-deploio-app my-app git@github.com:renuo/my-app.git +``` Please review the script before running it and execute only the commands you need and understand. In particular, you might need only one of the two environments if you decided to not use `develop`. diff --git a/ruby_on_rails/depfu.md b/ruby_on_rails/depfu.md index 1986dac9..8b55e7c9 100644 --- a/ruby_on_rails/depfu.md +++ b/ruby_on_rails/depfu.md @@ -17,9 +17,10 @@ Enable minor engine updates. ![Depfu Engine Updates](../images/depfu_engine_updates.png) -**Note:** If you are using Heroku, the latest Ruby / node version may not yet -be available on their platform, so you may need to delay the upgrade. Check the -following GitHub repositories to see if Heroku added support already: +> [!NOTE] +> If you are using Heroku, the latest Ruby / node version may not yet +> be available on their platform, so you may need to delay the upgrade. Check the +> following GitHub repositories to see if Heroku added support already: - - diff --git a/ruby_on_rails/devise.md b/ruby_on_rails/devise.md index f6e9f3f3..81abf266 100644 --- a/ruby_on_rails/devise.md +++ b/ruby_on_rails/devise.md @@ -1,6 +1,7 @@ # Devise -:warning: If you are going to use devise we suggest you to [send_emails](send_emails.md) first. :warning: +> [!WARNING] +> If you are going to use devise we suggest you to [send_emails](send_emails.md) first. * Add the following gem `gem 'devise'` and install it diff --git a/ruby_on_rails/linting_and_automatic_check.md b/ruby_on_rails/linting_and_automatic_check.md index 8b4cdd17..7112ee3f 100644 --- a/ruby_on_rails/linting_and_automatic_check.md +++ b/ruby_on_rails/linting_and_automatic_check.md @@ -7,8 +7,6 @@ Check out the `bin/fastcheck` [fastcheck](../templates/bin/fastcheck) for the fi ## Renuocop 👮 -> ✨ Installed by the Renuo Rails template (replaces `rubocop-rails-omakase`). - Renuocop is based on Standard Ruby and is a set of rules that we use to lint our Ruby code. You can execute it and correct the issues you'll find. @@ -17,9 +15,7 @@ You can execute it and correct the issues you'll find. ## Brakeman -> ✨ Ships with Rails 8.1 by default. - -Add it to the `bin/fastcheck` script. +Add it to the `bin/fastcheck` script: ```sh bundle exec brakeman -q -z --no-summary --no-pager @@ -37,7 +33,8 @@ end ## SCSS lint -> _Note_: Your Semaphore configuration might have to be adjusted if you decide to use `npm`. +> [!NOTE] +> Your Semaphore configuration might have to be adjusted if you decide to use `npm`. To lint the SASS/SCSS files in our project you can use the `stylelint` npm package. diff --git a/ruby_on_rails/object_storage.md b/ruby_on_rails/object_storage.md index 728d325a..b68268cf 100644 --- a/ruby_on_rails/object_storage.md +++ b/ruby_on_rails/object_storage.md @@ -51,7 +51,7 @@ The following Amazon services are involved in our app setups You will need Renuo-CLI to be set up and at the newest version: -`gem install renuo-cli` --> see [renuo-cli](https://github.com/renuo/renuo-cli) +`gem install renuo-cli` → see [renuo-cli](https://github.com/renuo/renuo-cli) Make sure `renuo -v` shows the [newest version](https://github.com/renuo/renuo-cli/tags) diff --git a/ruby_on_rails/rspec.md b/ruby_on_rails/rspec.md index 40b18250..08eb642d 100644 --- a/ruby_on_rails/rspec.md +++ b/ruby_on_rails/rspec.md @@ -1,6 +1,7 @@ # Setup RSpec -> **Note:** The Renuo Rails template does NOT set up RSpec. All steps on this page are manual. +> [!NOTE] +> The Renuo Rails template does NOT set up RSpec. All steps on this page are manual. > Rails 8.1 does ship `capybara` and `selenium-webdriver` in the `:test` group by default. There is no need to add those manually when using the template. Even though Rails uses Minitest per default, RSpec is the *de-facto* standard at Renuo. @@ -156,7 +157,8 @@ config.generators { |g| g.test_framework :rspec } * Add the line `bundle exec parallel_rspec` to `bin/check` -> **Note**: If you want to debug a spec, you can simply uncomment the line `SELENIUM_DRIVER` in the .env to not run it headless: +> [!NOTE] +> If you want to debug a spec, you can simply uncomment the line `SELENIUM_DRIVER` in the .env to not run it headless: ![CleanShot 2021-06-25 at 16 54 22](https://user-images.githubusercontent.com/1319150/123443347-1bbcae80-d5d6-11eb-8ba5-0d2c9ae4a37c.gif) @@ -170,8 +172,9 @@ We are now going to write a first test to ensure that the whole configuration is Commit and push your changes! 🎉 -> ⭐️ The default health check path for Rails is `/up`. [Learn more in the Rails guides](https://edgeapi.rubyonrails.org/classes/Rails/HealthController.html).\ -> To customize the health check and add additional checks, you can override the `Rails::HealthController` class.\ +> [!NOTE] +> The default health check path for Rails is `/up`. [Learn more in the Rails guides](https://edgeapi.rubyonrails.org/classes/Rails/HealthController.html). +> To customize the health check and add additional checks, you can override the `Rails::HealthController` class. > You can find an example that also checks the database connection [in this file](../templates/app/controllers/rails/health_controller.rb). ## Verify diff --git a/ruby_on_rails/sentry.md b/ruby_on_rails/sentry.md index 97fa88a9..10eb86aa 100644 --- a/ruby_on_rails/sentry.md +++ b/ruby_on_rails/sentry.md @@ -2,7 +2,7 @@ ## General configuration -* Go to https://www.sentry.io and login as the renuo monitor user. +* Go to and login as the renuo monitor user. * Create a project named `[project-name]`. diff --git a/ruby_on_rails/suggested_libraries.md b/ruby_on_rails/suggested_libraries.md index 256a5d93..bd6fdadd 100644 --- a/ruby_on_rails/suggested_libraries.md +++ b/ruby_on_rails/suggested_libraries.md @@ -3,9 +3,10 @@ Here is an hopefully up-to-date version of gems which we strongly suggest to include in your project. Please include them or find a good reason not to. -> :exclamation: Please follow the guide of each of these libraries to know how to properly install them. +> [!IMPORTANT] +> Please follow the guide of each of these libraries to know how to properly install them. -> **:bulb:** Do you know all of them? Do you know why we'd like them to be included? +Before adding these libraries, make sure you understand why each one is included. ```rb gem 'simple_form' @@ -25,4 +26,5 @@ group :production do end ``` -> **:bulb:** Note that to install `simple_form` you need to run `rails generate simple_form:install --bootstrap` (without option if not using Bootstrap) after adding it to your Gemfile. +> [!TIP] +> To install `simple_form`, run `rails generate simple_form:install --bootstrap` (omit the option if not using Bootstrap) after adding it to your Gemfile. diff --git a/ruby_on_rails/uptimerobot.md b/ruby_on_rails/uptimerobot.md index 241c084b..b3001d82 100644 --- a/ruby_on_rails/uptimerobot.md +++ b/ruby_on_rails/uptimerobot.md @@ -11,7 +11,7 @@ dyno. ## Setup You will need Renuo-CLI to be set up and at the newest version: -`gem install renuo-cli` --> see [renuo-cli](https://github.com/renuo/renuo-cli) +`gem install renuo-cli` → see [renuo-cli](https://github.com/renuo/renuo-cli) 1. Run the command `renuo setup-uptimerobot [url]` * Where `url` is the address you want to monitor. e.g. `https://[project-name]-main.renuoapp.ch/up` or `https://customdomain.ch/up` diff --git a/ruby_on_rails/vcr.md b/ruby_on_rails/vcr.md index e727f26b..c762ebc2 100644 --- a/ruby_on_rails/vcr.md +++ b/ruby_on_rails/vcr.md @@ -46,9 +46,9 @@ end ``` Some considerations: -* Do you really want/need VCR? A fake may be better: https://thoughtbot.com/blog/how-to-stub-external-services-in-tests#create-a-fake-hello-sinatra +* Do you really want/need VCR? A fake may be better: * Do you test so specifically that WebMock would be the better tool? -* Does your project have special needs for tweaks: https://blog.arkency.com/3-tips-to-tune-your-vcr-in-tests/ +* Does your project have special needs for tweaks: * How often do you want to re-record your cassettes? Out-of-date replays may give you a false sense of safety. * Where do you want to re-record your cassettes? Maybe nightly on the CI? diff --git a/ruby_on_rails/wallee.md b/ruby_on_rails/wallee.md index b4eec435..c1c83146 100644 --- a/ruby_on_rails/wallee.md +++ b/ruby_on_rails/wallee.md @@ -273,7 +273,7 @@ Be aware that this is quite integrated with the business logic of your app, e.g. let(:wallee_transaction_id) { "194681414" } - it "goes the 😊 path" do + it "goes the happy path" do create(:shop_order, wallee_transaction_id: wallee_transaction_id) post wallee_webhook_path, env: {"HTTP_X_SIGNATURE" => "fake"}, diff --git a/ruby_on_rails/wicked_pdf.md b/ruby_on_rails/wicked_pdf.md deleted file mode 100644 index 4c34f6f7..00000000 --- a/ruby_on_rails/wicked_pdf.md +++ /dev/null @@ -1,32 +0,0 @@ -# Wicked PDF - -Can be used to generate PDFs and supports HTML to PDF. - -:warning: Up to now, Wicked PDF does not support Bootstrap 4, so if you want to use Bootstrap 4 Templates, use another library :warning: - -* Add `gem 'wicked_pdf'` to the main section of `Gemfile` -* Add `gem 'wkhtmltopdf-binary'` to `group :development, :test` -* Add `gem 'wkhtmltopdf-heroku'` to `group :production` - -By default, it adds no layout, you you may want to add a layout: - -* Create a `pdf.pdf.erb` -* Use the method to add stylesheets : `wicked_pdf_stylesheet_link_tag 'pdf', media: 'all'` -* Use the method `wicked_pdf_image_tag` to insert images to the layout. - -*Usage:* - -```rb -render pdf: <>, print_media_type: true, layout: 'pdf', disposition: 'attachment' -``` - -:warning: Consider using a job-runner to not block the server during creation of PDFs. - -## Heroku - -Ensure that fonts are installed on Heroku, otherwise the PDF will look different compared to the one generated locally. The fonts need to be installed with a buildpack and put in the `~/.fonts` folder. -If you need Arial, you can add the following buildpack on Heroku: - -`https://github.com/propertybase/heroku-buildpack-fonts` - -:warning: Make sure you add this as a first buildpack before `heroku/ruby`! diff --git a/slack_and_notifications.md b/slack_and_notifications.md index b562c025..cf046c2b 100644 --- a/slack_and_notifications.md +++ b/slack_and_notifications.md @@ -18,7 +18,9 @@ One notification you may want to receive on this channel is about when a new dep order to do that you must be an admin of the Renuo Slack Organisation. If you are not an admin, ask wg-operations to do it for you communicating the `[project-name]`. -:warning: **You must have already setup [Automatic Deployment through SemaphoreCI](ruby_on_rails/configure_ci.md)** :warning: +> [!WARNING] +> You must have already setup [Automatic Deployment through SemaphoreCI](ruby_on_rails/configure_ci.md). + If you used Renuo CLI to configure SemaphoreCI, the notifications should be already created. For manual setup, follow these steps: 1. Open the global Notifications settings (`https://renuo.semaphoreci.com/notifications`) diff --git a/sparkpost_and_mailtrap.md b/sparkpost_and_mailtrap.md index 3575e069..064e3d85 100644 --- a/sparkpost_and_mailtrap.md +++ b/sparkpost_and_mailtrap.md @@ -1,8 +1,7 @@ # SparkPost & Mailtrap -⚠️ Always use subaccounts in Sparkpost! - -> Otherwise there may be compliance issues which can lead to the closing down of the whole Renuo account. +> [!WARNING] +> Always use subaccounts in Sparkpost! Otherwise there may be compliance issues which can lead to the closing down of the whole Renuo account. ## Introduction @@ -28,8 +27,8 @@ ## Sparkpost -:warning: -Always use subaccounts for the project, so that the whole account doesn't get suspended / blocked in case of compliance issues! +> [!WARNING] +> Always use subaccounts for the project, so that the whole account doesn't get suspended / blocked in case of compliance issues! 1. Go to and log in with the credentials for sparkpost+_enviroment_@renuo.ch found in the credential store diff --git a/templates/README.md b/templates/README.md index 7a88d9a6..539e15b6 100644 --- a/templates/README.md +++ b/templates/README.md @@ -4,10 +4,10 @@ Short project description ## Environments -| Branch | Domain | Deployment | -| ------- | ------------------------------------- | ---------------| -| develop | https://`[project-name]`-develop.renuoapp.ch | auto | -| main | https://`[project-name]`-main.renuoapp.ch | release | +| Branch | Domain | Deployment | +| ------- | ------------------------------------------ | ---------------| +| develop | https://[project-name]-develop.renuoapp.ch | auto | +| main | https://[project-name]-main.renuoapp.ch | release | ## Setup