Skip to content

Commit

Permalink
[Dev] Reduce config file clutter (#290)
Browse files Browse the repository at this point in the history
* Added local tooling config files to the tooling/ directory

* Moved as many docker-related files as possible

* Updated dockerfile path

* Updated the correct dockerfile instead how about

* Off day - jeez louise

* Juggled around some more dockerfiles

* more dockerfile

* More docker tests

* it's docker time

* One more shot
  • Loading branch information
kieraneglin authored Jun 13, 2024
1 parent 132f8e8 commit 781061b
Show file tree
Hide file tree
Showing 15 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: ./selfhosted.Dockerfile
file: ./docker/selfhosted.Dockerfile
# If the event is a release, use the release_arch, otherwise use the
# platforms input if present, falling back to dev_arch
platforms: ${{ github.event_name == 'release' && env.release_arch || (github.event.inputs.platforms || env.dev_arch) }}
Expand Down
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ services:
2. Prepare the docker image in one of the two ways below:
- **From GHCR:** `docker pull ghcr.io/kieraneglin/pinchflat:latest`
- NOTE: also available on Docker Hub at `keglin/pinchflat:latest`
- **Building locally:** `docker build . --file selfhosted.Dockerfile -t ghcr.io/kieraneglin/pinchflat:latest`
- **Building locally:** `docker build . --file docker/selfhosted.Dockerfile -t ghcr.io/kieraneglin/pinchflat:latest`
3. Run the container:

```bash
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
version: '3'
services:
phx:
build:
context: .
dockerfile: dev.Dockerfile
dockerfile: ./docker/dev.Dockerfile
environment:
- MIX_ENV=test
volumes:
Expand Down
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
version: '3'
services:
phx:
build:
context: .
dockerfile: dev.Dockerfile
dockerfile: ./docker/dev.Dockerfile
volumes:
- '.:/app'
ports:
- '4008:4008'
command:
- ./docker-run.dev.sh
command: bash -c "chmod +x docker/docker-run.dev.sh && docker/docker-run.dev.sh"
stdin_open: true
tty: true
env_file:
Expand Down
3 changes: 0 additions & 3 deletions dev.Dockerfile → docker/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ ENV LC_ALL en_US.UTF-8
WORKDIR /app
COPY . ./

# Needs permissions to be updated AFTER the copy step
RUN chmod +x ./docker-run.dev.sh

# Install Elixir deps
# RUN mix archive.install github hexpm/hex branch latest
RUN mix deps.get
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ defmodule Pinchflat.MixProject do
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
format: "format --dot-formatter=tooling/.formatter.exs",
check: "check --config=tooling/.check.exs",
credo: "credo --config-file=tooling/.credo.exs",
setup: ["deps.get", "ecto.setup", "assets.setup", "assets.build"],
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"sqleton": "^2.2.0"
},
"scripts": {
"create-erd": "sqleton -o priv/repo/erd.png priv/repo/pinchflat_dev.db"
"create-erd": "sqleton -o priv/repo/erd.png priv/repo/pinchflat_dev.db",
"lint:check": "prettier . --check --config=tooling/.prettierrc.js --ignore-path=tooling/.prettierignore --ignore-path=.gitignore",
"lint:fix": "prettier . --write --config=tooling/.prettierrc.js --ignore-path=tooling/.prettierignore --ignore-path=.gitignore"
},
"private": true
}
2 changes: 1 addition & 1 deletion .check.exs → tooling/.check.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{:compiler, env: %{"MIX_ENV" => "test"}},
{:formatter, env: %{"MIX_ENV" => "test"}},
{:sobelow, "mix sobelow --config"},
{:prettier_formatting, "yarn run prettier . --check", fix: "yarn run prettier . --write"},
{:prettier_formatting, "yarn run lint:check", fix: "yarn run lint:fix"},
{:npm_test, false}

## curated tools may be disabled (e.g. the check for compilation warnings)
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions tooling/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../assets/vendor/
File renamed without changes.

0 comments on commit 781061b

Please sign in to comment.