Skip to content

Commit 0e2b370

Browse files
committed
docker -> dc
dc is shorter to type, and in the end these commands are docker-compose wrappers indeed.
1 parent ce7b051 commit 0e2b370

File tree

13 files changed

+35
-36
lines changed

13 files changed

+35
-36
lines changed

config/initializers/ensure_rails_git_is_cloned.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
unless Dir.exists?(RAILS_GIT)
44
puts <<~EOS
55
Please, mirror the Rails repository using the command
6-
6+
77
git clone --mirror https://github.com/rails/rails.git
88
99
from the host computer.
10-
10+
1111
Once that is done, if you want to run the website please
1212
populate the database with
1313
14-
docker/sync
14+
dc/sync
1515
1616
This takes a while and it is not necessary if you only
1717
want to run the test suite.

dc/bash

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
exec dc/exec bash "$@"

dc/deploy

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
exec dc/exec cap production deploy

docker/exec renamed to dc/exec

File renamed without changes.

dc/psql

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
exec dc/rails db -p

dc/rails

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
exec dc/exec bin/rails "$@"

docker/server renamed to dc/server

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ if [[ $1 = 'staging' ]]; then
88
docker-compose exec -e RAILS_SERVE_STATIC_FILES=1 app \
99
bin/rails server -b 0.0.0.0 -e staging
1010
else
11-
docker/rails server -b 0.0.0.0
11+
dc/rails server -b 0.0.0.0
1212
fi

docker/sync renamed to dc/sync

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if [[ ! -d rails.git ]]; then
66
fi
77

88
if [[ $1 = 'all' ]]; then
9-
exec docker/rails runner "Repo.sync(rebuild_all: true)"
9+
exec dc/rails runner "Repo.sync(rebuild_all: true)"
1010
else
11-
exec docker/rails runner Repo.sync
11+
exec dc/rails runner Repo.sync
1212
fi

doc/docker.md

+17-18
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ If you just cloned the project:
66

77
```
88
$ docker-compose up -d
9-
$ docker/exec bundle install
10-
$ docker/rails db:setup
11-
$ docker/sync
9+
$ dc/exec bundle install
10+
$ dc/rails db:setup
11+
$ dc/sync
1212
```
1313

1414
The last command is going to clone the Rails repository and populate the database, it takes several minutes.
@@ -21,7 +21,7 @@ The application assumes `rails.git` is present in the root directory with a mirr
2121
git clone --mirror https://github.com/rails/rails.git
2222
```
2323

24-
That clone is performed by `docker/sync` automatically, but it does not update itself. To do so, please run
24+
That clone is performed by `dc/sync` automatically, but it does not update itself. To do so, please run
2525

2626
```
2727
$ cd rails.git
@@ -48,27 +48,26 @@ A number of convenience scripts are located in the `docker` directory, all of th
4848

4949
| Command | Description |
5050
| --------------- | -------------------------- |
51-
| `docker/bash` | Gets a Bash shell |
52-
| `docker/psql` | Gets a `psql` shell |
53-
| `docker/rails` | Runs `bin/rails` |
54-
| `docker/server` | Launches Puma in port 3000 |
55-
| `docker/sync` | Syncs the database |
56-
| `docker/deploy` | Deploys the application |
51+
| `dc/bash` | Gets a Bash shell |
52+
| `dc/psql` | Gets a `psql` shell |
53+
| `dc/rails` | Runs `bin/rails` |
54+
| `dc/server` | Launches Puma in port 3000 |
55+
| `dc/sync` | Syncs the database |
56+
| `dc/deploy` | Deploys the application |
5757

58-
The commands `docker/server` and `docker/psql` are convenience wrappers around `docker/rails`. In general `docker/rails` is the main command:
58+
The commands `dc/server` and `dc/psql` are convenience wrappers around `dc/rails`. In general `dc/rails` is the main command:
5959

6060
```
61-
$ docker/rails test
62-
$ docker/rails console
63-
$ docker/rails db:migrate
64-
$ docker/rails runner 'p Commit.count'
61+
$ dc/rails test
62+
$ dc/rails console
63+
$ dc/rails db:migrate
64+
$ dc/rails runner 'p Commit.count'
6565
$ ...
6666
```
6767

68-
The command `docker/server staging` runs the application in `staging` mode. That is a production-like environment (`config/environments/staging.rb` is a symlink to `config/environments/production.rb`), but it uses the development database and serves static files. If there are changes that act differently in `development` and `production`, this execution mode may be useful for checking things up before deployment.
68+
The command `dc/server staging` runs the application in `staging` mode. That is a production-like environment (`config/environments/staging.rb` is a symlink to `config/environments/production.rb`), but it uses the development database and serves static files. If there are changes that act differently in `development` and `production`, this execution mode may be useful for checking things up before deployment.
6969

70-
If you modify the name mappings, hard-coded authors, etc., `docker/sync`
71-
updates the credits and it does so changing as little as possible. The command also accepts an optional argument `all`, which forces the recomputation of all assignments. This is handy when you've changed the heuristics, and it takes less than a full database rebuild, since it does not reimport the commits themselves (which is costly).
70+
To update the local Rails checkout and update the credits run `dc/sync`. The command also accepts an optional argument `all`, which forces the recomputation of all assignments. This is handy when you've changed the heuristics, and it takes less than a full database rebuild, since it does not reimport the commits themselves (which is costly).
7271

7372
## Database persistence
7473

docker/bash

-3
This file was deleted.

docker/deploy

-3
This file was deleted.

docker/psql

-3
This file was deleted.

docker/rails

-3
This file was deleted.

0 commit comments

Comments
 (0)