Skip to content

Commit

Permalink
Move build.sh to bin/build
Browse files Browse the repository at this point in the history
Using bin/ for internal utils is the default for both Rails and Bundler.
The script has now no extension and is marked as executable improving its
usability (the user doesn't need to know how to deal with each extension) and
maintainability (it's easy to switch to a ruby script just changing the
shebang line).

The doc is updated and env variables are passed with `env` making life easier
for some non-bash shells such as fish-shell.
  • Loading branch information
elia committed Nov 23, 2018
1 parent 5707a64 commit ee8af2f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
.loadpath
.project
.ruby-version
bin/*
doc
Gemfile.lock
Gemfile-custom
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Here's a quick guide:
2. Run the tests. We only take pull requests with passing tests, and it's great
to know that you have a clean slate:

$ bash build.sh
$ bin/build

3. Create new branch then make changes and add tests for your changes. Only
refactoring and documentation changes require no new tests. If you are adding
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,16 @@ You can see the build statuses at
[ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/home) is
required to run the frontend and backend test suites.

To execute all of the test specs, run the `build.sh` script at the root of the Solidus project:
To execute all of the test specs, run the `bin/build` script at the root of the Solidus project:

```bash
bash build.sh
bin/build
```

The `build.sh` script runs using PostgreSQL by default, but it can be overridden by setting the DB environment variable to `DB=sqlite` or `DB=mysql`. For example:
The `bin/build` script runs using PostgreSQL by default, but it can be overridden by setting the DB environment variable to `DB=sqlite` or `DB=mysql`. For example:

```bash
DB=mysql bash build.sh
env DB=mysql bin/build
```

#### Run an individual test suite
Expand All @@ -236,7 +236,7 @@ By default, `rspec` runs the tests for SQLite 3. If you would like to run specs
against another database you may specify the database in the command:

```bash
DB=postgresql bundle exec rspec
env DB=postgresql bundle exec rspec
```

#### Code coverage reports
Expand Down
4 changes: 2 additions & 2 deletions build.sh → bin/build
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
#!/usr/bin/env bash

set -e

# Target postgresql. Override with: `DB=sqlite bash build.sh`
# Target postgresql. Override with: `env DB=sqlite bin/build`
export DB=${DB:-postgresql}

# Solidus defaults
Expand Down
14 changes: 7 additions & 7 deletions guides/source/developers/getting-started/develop-solidus.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You can prepend `DB=mysql` or `DB=postgresql` to the command in order use those
databases instead of the default SQLite 3 database. For example:

```bash
DB=postgresql bundle exec rake sandbox
env DB=postgresql bundle exec rake sandbox
```

After the sandbox has been generated, you can change into its directory and
Expand Down Expand Up @@ -68,19 +68,19 @@ You can see the build statuses [on our CircleCI status page][circleci].

### Run all Solidus test suites

To execute all of the test specs, run the `build.sh` script at the root of the
To execute all of the test specs, run the `bin/build` script at the root of the
Solidus project:

```bash
bash build.sh
bin/build
```

The `build.sh` script runs using PostgreSQL by default, but it can be overridden
The `bin/build` script runs using PostgreSQL by default, but it can be overridden
by setting the `DB` environment variable to `DB=sqlite` or `DB=mysql`. For
example:

```bash
DB=mysql bash build.sh
env DB=mysql bin/build
```

Note that this will fail if you have not installed ChromeDriver on your system.
Expand All @@ -99,7 +99,7 @@ By default, the tests run against the default SQLite 3 database. You can instead
specify `DB=mysql` or `DB=postgresql` by prepending it to the command:

```bash
DB=postgresql bundle exec rspec
env DB=postgresql bundle exec rspec
```

### Generate a code coverage report
Expand All @@ -108,7 +108,7 @@ You can generate a [SimpleCov][simplecov] code
coverage report by prepending `COVERAGE=true` to the `rspec` command:

```bash
COVERAGE=true bundle exec rspec
env COVERAGE=true bundle exec rspec
```

[simplecov]: https://github.com/colszowka/simplecov
Expand Down

0 comments on commit ee8af2f

Please sign in to comment.