bullet_train 1.8.0 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/field-partials/file-field.md +0 -16
- data/docs/heroku.md +76 -8
- data/docs/themes.md +39 -1
- data/lib/bullet_train/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8439eda640e8c1d745f2dbe08256bf47218ac7fc96b6f1cdbf7ffcf6b17ff3a
|
4
|
+
data.tar.gz: a0400e30a033d58cd07cf99fe83469426dc8e6222850f38f060990d07e13618b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54651f07241eebd2ab13e6d4512e615d852896acadb32edc11bcf8091ada58e5a03579047fc18faa54c4391981c8f14a5ef4411baea0487142418f7e5f11e072
|
7
|
+
data.tar.gz: 1fc7f8eafe3e0a82c7e3d6ba28a45278361ba9a56a49c2296e96d36024783cac263b8c022b0457aaf9555e52f7f3b329bd083fd969c4bc613a2a893c8d4f91ae
|
@@ -10,14 +10,6 @@ In addition, Bullet Train has integrated the direct-uploads feature of Active St
|
|
10
10
|
|
11
11
|
The following steps illustrate how to add a `document` file attachment to a `Post` model.
|
12
12
|
|
13
|
-
Add the following to `app/models/post.rb`:
|
14
|
-
|
15
|
-
```ruby
|
16
|
-
has_one_attached :document
|
17
|
-
```
|
18
|
-
|
19
|
-
Note, no database migration is required as ActiveStorage uses its own tables to store the attachments.
|
20
|
-
|
21
13
|
Run the following command to generate the scaffolding for the `document` field on the `Post` model:
|
22
14
|
|
23
15
|
```bash
|
@@ -28,14 +20,6 @@ rails generate super_scaffold:field Post document:file_field
|
|
28
20
|
|
29
21
|
The following steps illustrate how to add multiple `document` file attachments to a `Post` model.
|
30
22
|
|
31
|
-
Add the following to `app/models/post.rb`:
|
32
|
-
|
33
|
-
```ruby
|
34
|
-
has_many_attached :documents
|
35
|
-
```
|
36
|
-
|
37
|
-
Note, no database migration is required as ActiveStorage uses its own tables to store the attachments.
|
38
|
-
|
39
23
|
Run the following command to generate the scaffolding for the `documents` field on the `Post` model:
|
40
24
|
|
41
25
|
```bash
|
data/docs/heroku.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Deploying to Heroku
|
2
2
|
|
3
|
-
|
3
|
+
## Taking Bullet Train for a test drive
|
4
4
|
|
5
|
-
|
5
|
+
If you just want to take this project for a test drive on Heroku without starting your own application you can use this button:
|
6
|
+
|
7
|
+
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://www.heroku.com/deploy?template=https://github.com/bullet-train-co/bullet_train)
|
6
8
|
|
7
9
|
This button leverages the configuration found in `app.json`, including sensible demo-ready defaults for dyno formation, third-party services, buildpack configuration, etc.
|
8
10
|
|
@@ -10,6 +12,8 @@ The resources provisioned will cost about **$22/month**.
|
|
10
12
|
|
11
13
|
**Please note:** The resources provisioned via `app.json` are intended to be used for quickly launching your brand new app so that you can demo it easily. When you're ready to go into production you'll want to make some changes to these resources. See the section at the bottom of this page.
|
12
14
|
|
15
|
+
We also have a a demo site that you can try without needing to deploy anything. You can [sign up if you haven't tried it before](/users/sign_up) or if you can [sign in if you've already given it a test run](/users/sign_in).
|
16
|
+
|
13
17
|
## What's Included?
|
14
18
|
|
15
19
|
### Required Add-Ons
|
@@ -25,23 +29,87 @@ We've included the "entry-level" service tier across the board for:
|
|
25
29
|
- [Honeybadger](https://www.honeybadger.io) for error tracking.
|
26
30
|
- [Expedited Security](https://expeditedsecurity.com)'s [Real Email](https://elements.heroku.com/addons/realemail) to reduce accounts created with fake and unreachable emails, which will subsequently hurt your email deliverability.
|
27
31
|
|
28
|
-
##
|
32
|
+
## Deploying a real application
|
33
|
+
|
34
|
+
When you're ready to deploy your own application based on Bullet Train there are a few steps that need to be performed manually using the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli):
|
35
|
+
|
36
|
+
### 1. Clone the repo and bootstrap your app
|
37
|
+
|
38
|
+
Follow the [normal instructions for getting started](https://github.com/bullet-train-co/bullet_train?tab=readme-ov-file#building-a-new-application-with-bullet-train)
|
39
|
+
and during the `bin/configure` process be sure to choose to push your app to GitHub and to choose to add a "Deploy to Heroku" button.
|
40
|
+
|
41
|
+
After doing that you'll have a copy of the starter repo that has been customized with your application name and settings.
|
42
|
+
|
43
|
+
### 2. Deploy to Heroku using your own "Deploy to Heroku" button
|
44
|
+
|
45
|
+
Now go to your repo on GitHub and look for the "Deploy to Heroku" button.
|
29
46
|
|
30
|
-
|
47
|
+
If you don't have one (or if it's not working right) you can add a new button to your README by running:
|
31
48
|
|
32
|
-
|
49
|
+
```
|
50
|
+
./bin/configure-scripts/deploy_button_heroku.rb
|
51
|
+
```
|
52
|
+
|
53
|
+
After generating the button be sure to commit the change and push to your GitHub repo.
|
54
|
+
|
55
|
+
Click the "Deploy to Heroku" button in your repo and you'll be taken to a screen where you can start the deployment process.
|
56
|
+
|
57
|
+
### 3. Add Heroku as a Remote in Your Local Repository
|
58
|
+
|
59
|
+
Once your application has been created use the name that you gave it to set up a git remote for `heroku`:
|
33
60
|
|
34
61
|
```
|
35
62
|
heroku git:remote -a YOUR_HEROKU_APP_NAME
|
36
63
|
```
|
37
64
|
|
65
|
+
### 4. Push to heroku
|
66
|
+
|
38
67
|
After this, you'll be able to deploy updates to your app like so:
|
39
68
|
|
40
69
|
```
|
41
70
|
git push heroku main
|
42
71
|
```
|
43
72
|
|
44
|
-
|
73
|
+
## Configuring automatic deploys
|
74
|
+
|
75
|
+
We include some pre-built workflows for GitHub actions that can run the test suite and automatically deploy your code to
|
76
|
+
either a staging or a production environment.
|
77
|
+
|
78
|
+
`.github/workflows/ci-cd-pipeline-main.yml` is a workflow that is run any time that new code lands on your `main` branch.
|
79
|
+
|
80
|
+
At the bottom of the workflow is a block for automatically deploying to Heroku. It's commented out by default but you can un-comment
|
81
|
+
it and set the `heroku-app-name` value to be the name of your new app in Heroku.
|
82
|
+
|
83
|
+
If you don't want to deploy directly to production you could create a staging app in Heroku (by following the directions above but giving
|
84
|
+
the new app a different name) and then add your staging and production apps to a pipeline. Then you could configure `ci-cd-pipeline-main.yml`
|
85
|
+
to deploy to your staging app. Then you can use the Heroku pipeline functionality to promote versions of your app from staging to production.
|
86
|
+
|
87
|
+
If you don't want to use Heroku pipelines but still want to have automated deploys to production that are triggered intentionally (not on every
|
88
|
+
change to `main`) then you could duplicate `ci-cd-pipeline-main.yml` to something like `ci-cd-pipeline-production.yml` and change the conditions
|
89
|
+
under which the workflow is run.
|
90
|
+
|
91
|
+
For instance if you wanted to automatically deploy to production when a new verison tag is added to your GitHub repo you could change the `on:` block
|
92
|
+
in the workflow file to be something like this:
|
93
|
+
|
94
|
+
```
|
95
|
+
on:
|
96
|
+
push:
|
97
|
+
tags:
|
98
|
+
- 'v[0-9]+.[0-9]+.[0-9]+'
|
99
|
+
```
|
100
|
+
|
101
|
+
With that you could then deploy to prod by doing something like this:
|
102
|
+
|
103
|
+
```
|
104
|
+
git tag v0.0.1
|
105
|
+
git push origin --tags
|
106
|
+
```
|
107
|
+
|
108
|
+
Then the workflow would be triggered, it would run your test suite, and then deploy to whichever app you've configured in the workflow file.
|
109
|
+
|
110
|
+
## Additional setup
|
111
|
+
|
112
|
+
### 1. Improve Boot Time
|
45
113
|
|
46
114
|
You can cut your application boot time in half by enabling the following Heroku Labs feature. See [this blog post](https://dev.to/dbackeus/cut-your-rails-boot-times-on-heroku-in-half-with-a-single-command-514d) for more details.
|
47
115
|
|
@@ -49,7 +117,7 @@ You can cut your application boot time in half by enabling the following Heroku
|
|
49
117
|
heroku labs:enable build-in-app-dir
|
50
118
|
```
|
51
119
|
|
52
|
-
###
|
120
|
+
### 2. Adding Your Actual Domain
|
53
121
|
|
54
122
|
The most common use case for Bullet Train applications is to be hosted at some appropriate subdomain (e.g. `app.YOURDOMAIN.COM`) while a marketing site is hosted with a completely different service at the apex domain (e.g. just `YOURDOMAIN.COM`) or `www.YOURDOMAIN.COM`. To accomplish this, do the following in your shell:
|
55
123
|
|
@@ -81,7 +149,7 @@ heroku certs:auto
|
|
81
149
|
|
82
150
|
You should be done now and your app should be available at `https://app.YOURDOMAIN.COM/account` and any hits to `https://app.YOURDOMAIN.COM` (e.g. when users sign out, etc.) will be redirected to your marketing site.
|
83
151
|
|
84
|
-
###
|
152
|
+
### 3. Configure CORS on Your S3 Bucket
|
85
153
|
|
86
154
|
Before you can upload to your freshly provisioned S3 bucket, you need to run (on Heroku) a rake task we've created for you to set the appropriate CORS settings.
|
87
155
|
|
data/docs/themes.md
CHANGED
@@ -8,6 +8,44 @@ To reduce duplication of code across themes, Bullet Train implements the followi
|
|
8
8
|
|
9
9
|
This is where all of Bullet Train's standard views are contained.
|
10
10
|
|
11
|
+
## Adding a New Theme (CSS only)
|
12
|
+
|
13
|
+
The easiest way to get started customizing Bullet Train is by definiing a custom set of primary and secondary colors for your own theme.
|
14
|
+
|
15
|
+
Open `app/assets/stylesheets/application.css` then define a new set of colors with a custom theme name. Something like this:
|
16
|
+
|
17
|
+
```css
|
18
|
+
.theme-foo {
|
19
|
+
--primary-50: #fff6e0;
|
20
|
+
--primary-100: #ffebb3;
|
21
|
+
--primary-200: #ffdf80;
|
22
|
+
--primary-300: #ffd24d;
|
23
|
+
--primary-400: #ffc71f;
|
24
|
+
--primary-500: #F2B705;
|
25
|
+
--primary-600: #d99804;
|
26
|
+
--primary-700: #b07803;
|
27
|
+
--primary-800: #865802;
|
28
|
+
--primary-900: #5c3901;
|
29
|
+
|
30
|
+
--secondary-50: #fde8ea;
|
31
|
+
--secondary-100: #fac9ce;
|
32
|
+
--secondary-200: #f19aa2;
|
33
|
+
--secondary-300: #e76b76;
|
34
|
+
--secondary-400: #dc3e4c;
|
35
|
+
--secondary-500: #BF2431;
|
36
|
+
--secondary-600: #9b1c28;
|
37
|
+
--secondary-700: #77151f;
|
38
|
+
--secondary-800: #530e15;
|
39
|
+
--secondary-900: #32080d;
|
40
|
+
}
|
41
|
+
```
|
42
|
+
|
43
|
+
Then open `config/initializers/theme.rb` and change the theme name like this:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
BulletTrain::Themes::Light.color = :foo
|
47
|
+
```
|
48
|
+
|
11
49
|
## Adding a New Theme (ejecting standard views)
|
12
50
|
|
13
51
|
If you want to add a new theme, you can use the following command. For example, let's make a new theme called "foo":
|
@@ -83,4 +121,4 @@ You're going to have to call your theme something and there are practical reason
|
|
83
121
|
## Additional Themes Documentation
|
84
122
|
|
85
123
|
* [Installing Bullet Train Themes on Other Rails Projects](/docs/themes/on-other-rails-projects.md)
|
86
|
-
* [Installing Bullet Train Themes on Jumpstart Pro Projects](/docs/themes/on-jumpstart-pro-projects.md)
|
124
|
+
* [Installing Bullet Train Themes on Jumpstart Pro Projects](/docs/themes/on-jumpstart-pro-projects.md)
|
data/lib/bullet_train/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bullet_train
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|