Skip to content

Commit a98611a

Browse files
committed
Clean up readme and some other misc files
1 parent c65ef20 commit a98611a

5 files changed

Lines changed: 541 additions & 41 deletions

File tree

.env.example

Lines changed: 0 additions & 6 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# If you find yourself ignoring temporary files generated by your text editor
44
# or operating system, you probably want to add a global ignore instead:
55
# git config --global core.excludesfile '~/.gitignore_global'
6+
.lesshst
67

78
# Ignore bundler config.
89
/.bundle

README.md

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
Oregon Digital
2-
---
1+
# Oregon Digital
32

43
[![CircleCI](https://circleci.com/gh/OregonDigital/OD2.svg?style=svg)](https://circleci.com/gh/OregonDigital/OD2)
54
[![Coverage Status](https://coveralls.io/repos/github/OregonDigital/OD2/badge.svg?branch=master)](https://coveralls.io/github/OregonDigital/OD2?branch=master)
65

7-
Docker Setup
8-
---
6+
## Docker Setup
97

108
### Requirements
119

@@ -14,26 +12,30 @@ The details provided assume that the official Docker daemon is running in the ba
1412
**Suggested:** If using ohmyzsh (http://ohmyz.sh/), add the docker-compose plugin to the .zshrc for better command-line aliases and integration.
1513

1614
**Important:** _By default, docker will run the services in the context of
17-
`RAILS_ENV=development`_, and there is no valid AWS configuration. You can
18-
copy the included `.env.example` to `.env` and override these things if desired.
15+
`RAILS_ENV=development`_. All environment variables are handled in the `docker-compose.yml` file or you may copy `docker-compose.override.yml-example` to `docker-compose.override.yml` to add additional docker configuration.
1916

2017
**Important:** It's a known issue that Java, in docker images built for x86, ran through Apple's Rosetta2 for M1 chips cause constant errors & crashes.
2118
The `docker-compose.yml` has a `build` option for Blazegraph and FCrepo. If you're using an M1 mac you should comment out the `image` section and uncomment the `build` ones for these services.
2219
This will build those images from the `m1` directory, which are copy+paste's from their respective GitHub repos, with the only change being selecting the armv8 base image version.
2320

2421
### Docker notes
2522

23+
Here are some useful docker commands that may be relevant to you
24+
2625
- `$ docker system prune` : A command that will reclaim disk space by deleting stopped containers, networks, dangling images and build cache.
2726
- `$ docker volume ls` : Show a list of named volumes which hold persistent data for containers.
2827
- `$ docker volume rm [VOLUME NAME]` : Remove a named volume, to force the system to rebuild and start that services persistent data from scratch.
28+
And here are some useful docker-compose commands
29+
- `$ docker compose up server -d` : Start just the development environment
30+
- `$ docker compose down` : Stop all environments
31+
- `$ docker compose logs -f server` : Follow the logs from just the rails application
2932

30-
Development Workflow
31-
---
33+
## Development Workflow
3234

3335
### Starting from scratch
3436

3537
You shouldn't need to do these steps often, but you **should** read them and
36-
understand them. A "fresh start" can be necessary at times, especially when
38+
understand them. A "fresh start" can be necessary at times, especially when
3739
getting back to OD2 after a lot of development has taken place by others.
3840

3941
First, clone OD2:
@@ -43,26 +45,21 @@ git clone git@github.com:OregonDigital/OD2.git
4345
cd OD2
4446
```
4547

46-
Next, build the app image *with your user id*, otherwise permissions will not work
47-
for development! If your system doesn't have the `id` command, you'll need to
48-
manually determine your user id *and* your group id, otherwise things could get
48+
Next, build the app image _with your user id_, otherwise permissions will not work
49+
for development! If your system doesn't have the `id` command, you'll need to
50+
manually determine your user id _and_ your group id, otherwise things could get
4951
really weird.
5052

5153
```bash
5254
docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) server workers app test dev
5355
```
5456

55-
**Note**: This will take a *very* long time the first time you do it.
56-
Potentially 30 minutes or longer. I'm not kidding, I'm timing it right now and
57-
it's ... well, kind of amazing but in a terrible way. I'm at 20 minutes and
58-
still waiting on the "fits" download. So go take a break. Get a coffee. Do
59-
whatever cliched things people do when waiting for a slow thing to occur. You
60-
might have time for a short vacation. Not like... a trip to Cabo, but maybe a
61-
local bed and breakfast. That could be nice, right?
57+
**Note**: This will take a _very_ long time the first time you do it.
58+
Potentially 30 minutes or longer. We're not kidding.
6259

6360
Once built, you shouldn't need to rebuild the image unless you're changing the
64-
`Dockerfile`, suspect a bad cached build, or can't get gems to install via
65-
in-container runs of `bundler`. And subsequent builds will be a bit faster
61+
`Dockerfile` or `Gemfile`, suspect a bad cached build, or can't get gems to install via
62+
in-container runs of `bundler`. Subsequent builds will be a bit faster
6663
(usually) than the initial build, because you won't have to download things
6764
like the base Ruby image, and you typically won't have to reinstall core
6865
dependencies like libreoffice.
@@ -75,7 +72,7 @@ cp docker-compose.override.yml-example docker-compose.override.yml
7572
```
7673

7774
This file contains configuration you may expect and even require for typical
78-
development. Feel free to tweak and override base settings here; this file is
75+
development. Feel free to tweak and override base settings here; this file is
7976
meant to hold all the custom environment that's particular to individual
8077
developers.
8178

@@ -96,17 +93,16 @@ _Open another terminal window (unless you run the previous command `detached`)._
9693
On the first time building and starting the server, or any time you destroy the
9794
stack's data volumes, Hyrax defaults must be created and loaded:
9895

99-
*("docker-compose exec" only works if the server is running. The first-run
100-
command only works if the server has already been initialized. **Make sure
101-
migrations have finished running** before you do these steps.)*
96+
_("docker-compose exec" only works if the server is running. The first-run
97+
command only works if the server has already been initialized. **Make sure
98+
migrations have finished running** before you do these steps.)_
10299

103100
```bash
104101
docker-compose exec server ./build/firstrun.sh
105102
```
106103

107-
This will take a few minutes. Once it's done, you can visit
108-
`http://localhost:3000/users/sign_in?locale=en` and log in as
109-
"admin@example.org" with the password "admin123".
104+
This will take a few minutes. Once it's done, you can visit
105+
`http://localhost:3000/users/sign_in?locale=en` to
110106

111107
### Manual setup
112108

@@ -131,8 +127,7 @@ Return to the server container shell session, start Rails console, create an `ad
131127

132128
Login to the app, and continue configuration or depositing works using the Hyrax UI.
133129

134-
Testing workflow
135-
---
130+
## Testing workflow
136131

137132
Testing the application amounts to running all of the required services along side an instance of the application and then running the testing framework against those containers. All of the `*-test` services have applicable environment variables injected to the containers during boot.
138133

@@ -153,11 +148,10 @@ Start a session, and run `rspec` on the test (application) container. _(This met
153148

154149
docker-compose exec test rspec
155150

156-
Do *not* use `docker-compose run` - it will fire up the entrypoint script,
151+
Do _not_ use `docker-compose run` - it will fire up the entrypoint script,
157152
which starts up Puma for the capybara tests.
158153

159-
Additional Notes
160-
---
154+
## Additional Notes
161155

162156
### Controlling Workers
163157

@@ -179,4 +173,3 @@ It may behoove you to create an alias for this kind of thing:
179173
alias dwork='docker-compose exec -u 1000 workers'
180174
dwork rake -T
181175
dwork rails generate ...
182-

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add your own tasks in files placed in lib/tasks ending in .rake,
22
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
33

4-
require_relative 'config/application'
4+
require_relative "config/application"
55

66
Rails.application.load_tasks

0 commit comments

Comments
 (0)