Skip to content

Commit 1f039a8

Browse files
committed
Add Default Rails Deploy Script On Hatchbox as a devops TIL
1 parent c6eefea commit 1f039a8

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
1010

1111
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
1212

13-
_1575 TILs and counting..._
13+
_1576 TILs and counting..._
1414

1515
See some of the other learning resources I work on:
1616
- [Ruby Operator Lookup](https://www.visualmode.dev/ruby-operators)
@@ -199,6 +199,7 @@ See some of the other learning resources I work on:
199199
- [Check The Status of All Services](devops/check-the-status-of-all-services.md)
200200
- [Check The Syntax Of nginx Files](devops/check-the-syntax-of-nginx-files.md)
201201
- [Connect To An RDS PostgreSQL Database](devops/connect-to-an-rds-postgresql-database.md)
202+
- [Default Rails Deploy Script On Hatchbox](devops/default-rails-deploy-script-on-hatchbox.md)
202203
- [Determine The IP Address Of A Domain](devops/determine-the-ip-address-of-a-domain.md)
203204
- [Hatchbox Exports Env Vars With asdf](devops/hatchbox-exports-env-vars-with-asdf.md)
204205
- [Path Of The Packets](devops/path-of-the-packets.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Default Rails Deploy Script On Hatchbox
2+
3+
I deployed a Rails app to [Hatchbox](https://hatchbox.io) recently. When
4+
following along in the log during a deploy, I can see most of what is happening
5+
as part of the deploy. Though it is too verbose to look through every line. I'd
6+
rather see the contents of the deploy script.
7+
8+
I did quite a bit of digging around while SSH'd into my hatchbox server, but I
9+
couldn't find if or where that file might be stored.
10+
11+
Instead, there is a [_Help Center_
12+
article](https://hatchbox.relationkit.io/articles/55-what-is-the-default-rails-deploy-script)
13+
where Chris Oliver shares what is in the script.
14+
15+
```bash
16+
bundle install -j $(nproc)
17+
yarn install
18+
bundle exec rails assets:precompile
19+
[[ -n "${CRON}" ]] && bundle exec rails db:migrate
20+
```
21+
22+
It does a parallelized `bundle install`, then a `yarn install` (make sure your
23+
project is using `yarn.lock`), Rails asset precompilation, and then if `CRON`
24+
is set (Cron role is available by checking _Cron_ under _Server
25+
Responsibilities_ for your Hatchbox server), it will run Rails migrations.
26+
27+
From app settings, the deploy script can be overridden, or pre- and post-deploy
28+
steps can be added.

0 commit comments

Comments
 (0)