diff --git a/README.md b/README.md index 7a2702e..c2967a1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186). -_1575 TILs and counting..._ +_1576 TILs and counting..._ See some of the other learning resources I work on: - [Ruby Operator Lookup](https://www.visualmode.dev/ruby-operators) @@ -199,6 +199,7 @@ See some of the other learning resources I work on: - [Check The Status of All Services](devops/check-the-status-of-all-services.md) - [Check The Syntax Of nginx Files](devops/check-the-syntax-of-nginx-files.md) - [Connect To An RDS PostgreSQL Database](devops/connect-to-an-rds-postgresql-database.md) +- [Default Rails Deploy Script On Hatchbox](devops/default-rails-deploy-script-on-hatchbox.md) - [Determine The IP Address Of A Domain](devops/determine-the-ip-address-of-a-domain.md) - [Hatchbox Exports Env Vars With asdf](devops/hatchbox-exports-env-vars-with-asdf.md) - [Path Of The Packets](devops/path-of-the-packets.md) diff --git a/devops/default-rails-deploy-script-on-hatchbox.md b/devops/default-rails-deploy-script-on-hatchbox.md new file mode 100644 index 0000000..604d9b6 --- /dev/null +++ b/devops/default-rails-deploy-script-on-hatchbox.md @@ -0,0 +1,28 @@ +# Default Rails Deploy Script On Hatchbox + +I deployed a Rails app to [Hatchbox](https://hatchbox.io) recently. When +following along in the log during a deploy, I can see most of what is happening +as part of the deploy. Though it is too verbose to look through every line. I'd +rather see the contents of the deploy script. + +I did quite a bit of digging around while SSH'd into my hatchbox server, but I +couldn't find if or where that file might be stored. + +Instead, there is a [_Help Center_ +article](https://hatchbox.relationkit.io/articles/55-what-is-the-default-rails-deploy-script) +where Chris Oliver shares what is in the script. + +```bash +bundle install -j $(nproc) +yarn install +bundle exec rails assets:precompile +[[ -n "${CRON}" ]] && bundle exec rails db:migrate +``` + +It does a parallelized `bundle install`, then a `yarn install` (make sure your +project is using `yarn.lock`), Rails asset precompilation, and then if `CRON` +is set (Cron role is available by checking _Cron_ under _Server +Responsibilities_ for your Hatchbox server), it will run Rails migrations. + +From app settings, the deploy script can be overridden, or pre- and post-deploy +steps can be added.