Skip to content

Instantly share code, notes, and snippets.

@r00k
Last active December 29, 2018 16:41
Show Gist options
  • Select an option

  • Save r00k/a614e5dfce1d291337950460b1f858e6 to your computer and use it in GitHub Desktop.

Select an option

Save r00k/a614e5dfce1d291337950460b1f858e6 to your computer and use it in GitHub Desktop.

Revisions

  1. r00k revised this gist Nov 25, 2018. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@
    ```
    #!/bin/sh

    # Set up Rails app. Run this script immediately after cloning the codebase.
    @@ -30,6 +29,4 @@ if [ -z "$CI" ]; then
    # Join the apps
    heroku join --app this-app-staging || true
    heroku join --app this-app-production || true
    fi
    ```

    fi
  2. r00k revised this gist Nov 25, 2018. No changes.
  3. r00k created this gist Nov 25, 2018.
    35 changes: 35 additions & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    ```
    #!/bin/sh
    # Set up Rails app. Run this script immediately after cloning the codebase.
    # Exit if any subcommand fails
    set -e
    # Copy over configs
    if ! [ -f .env ]; then
    cp .sample.env .env
    fi
    # Set up Ruby dependencies via Bundler
    gem install bundler --conservative
    bundle check || bundle install
    # Set up database
    bin/rake db:setup db:test:prepare
    # Only if this isn't CI
    if [ -z "$CI" ]; then
    # Set up development seed data
    bin/rake dev:bootstrap
    # Add Heroku remotes
    git remote add staging https://git.heroku.com/this-app-staging.git || true
    git remote add production https://git.heroku.com/this-app-production.git || true
    # Join the apps
    heroku join --app this-app-staging || true
    heroku join --app this-app-production || true
    fi
    ```