Skip to content

Commit

Permalink
Create Makefile for content setup (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
doomspork committed Jun 15, 2021
1 parent 33df0cf commit 40ef2ee
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 24 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
@@ -0,0 +1,8 @@
content/
README.md
test/
.git/
.github/
.credo.exs
.formatter.exs
heroku.yml
13 changes: 1 addition & 12 deletions Dockerfile
Expand Up @@ -17,30 +17,19 @@ ENV MIX_ENV=prod
COPY mix.exs mix.lock ./
COPY config config
RUN mix do deps.get, deps.compile

# compile and build release
COPY lib lib

# build assets
COPY assets/package.json assets/package-lock.json ./assets/
RUN npm --prefix ./assets ci --progress=false --no-audit --loglevel=error

COPY priv priv
COPY assets assets

RUN git clone https://github.com/elixirschool/elixirschool.git content && \
cd content && \
git fetch --all && \
git checkout content-only-changes && \
cd .. && \
mkdir -p assets/static/images && \
mv content/images/* assets/static/images
RUN make content

RUN npm run --prefix ./assets deploy
RUN mix phx.digest

# uncomment COPY if rel/ exists
# COPY rel rel
RUN mix do compile, release

# prepare release image
Expand Down
9 changes: 9 additions & 0 deletions Makefile
@@ -0,0 +1,9 @@
.PHONY: $(MAKECMDGOALS)

setup: content
mix do deps.get, compile
npm install --prefix assets

content:
git clone --branch content-only-changes --single-branch --depth 1 https://github.com/elixirschool/elixirschool.git content
ln -s content/images/* assets/static
16 changes: 4 additions & 12 deletions README.md
Expand Up @@ -8,18 +8,10 @@ By leveraging Dashbit's [NimblePublisher](https://github.com/dashbitco/nimble_pu

## Development

At this time there's a little more work to setup for local development.
We'll need to checkout a specific branch from `elixirschool/elixirschool` that's already had some processing done to the lessons to work with NimblePublisher. We'll also need to link the images in the aforementioned branch to our assets folder for Phoenix to pickup.
To get up and running all we need is a single command:

```shell
$ git clone git@github.com:elixirschool/school_house.git
$ cd school_house
$ git clone git@github.com:elixirschool/elixirschool.git content
$ cd content
$ git fetch --all
$ git checkout lessons-only
$ cd ..
$ ln -s content/images assets/static
```elixir
$ make setup
```

From here the rest is as you would expect with Phoenix! :tada:
This will fetch our dependencies and setup our content from the external repository.
File renamed without changes.
File renamed without changes.

0 comments on commit 40ef2ee

Please sign in to comment.