Skip to content

Commit

Permalink
Revert "markdownのFencedCodeに対応する"
Browse files Browse the repository at this point in the history
  • Loading branch information
kfly8 authored May 16, 2024
1 parent 8f339b8 commit e108833
Show file tree
Hide file tree
Showing 13 changed files with 414 additions and 442 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:

- name: Run test
run: |
make ci
make test
41 changes: 0 additions & 41 deletions .github/workflows/update-cpanfile-snapshot.yml

This file was deleted.

24 changes: 14 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,27 @@ RUN apt-get update && \
apt-get -y upgrade && \
apt-get install -y wget gcc g++ make sqlite3

RUN cpm install -g Carton

WORKDIR /usr/src/app

COPY cpanfile cpanfile.snapshot .
COPY cpanfile ./
RUN cpm install
COPY . .

RUN sqlite3 perldocjp.master.db < sql/sqlite.sql
RUN cp perldocjp.master.db perldocjp.slave.db

ENV PLACK_ENV=docker
ENV PERL5LIB=/usr/src/app/local/lib/perl5
ENV PATH=/usr/src/app/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

# 翻訳データの更新
RUN perl script/update.pl

FROM base as app

RUN carton install --deployment
COPY . .

RUN sqlite3 perldocjp.master.db < sql/sqlite.sql
RUN cp perldocjp.master.db perldocjp.slave.db

# テスト用のステージ
FROM base as test
RUN cpm install --with-test --with-develop --show-build-log-on-failure

# サーバーを起動したい時のステージ
FROM base as web
CMD ["./local/bin/plackup", "-p", "5000", "-Ilib", "app.psgi"]
24 changes: 6 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@

.PHONY: build
build:
docker compose build
docker-compose -f docker-compose.yml build web

.PHONY: up
up:
docker compose up
make build
docker-compose -f docker-compose.yml up -d web

.PHONY: down
down:
docker compose down
docker-compose -f docker-compose.yml down

.PHONY: test
test: TEST_TARGET = t
test:
docker compose exec app prove -lrv $(TEST_TARGET)

.PHONY: ci
ci:
docker compose up -d
make setup-data
make test

# 翻訳データのセットアップ
# TODO: 翻訳データのセットアップは他にもあるので、全部ひとまとめにできると良さそう
.PHONY: setup-data
setup-data:
docker compose exec app perl script/update.pl

docker-compose -f docker-compose.yml build test
docker-compose -f docker-compose.yml run test prove -Ilib -r -v t
3 changes: 1 addition & 2 deletions cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ requires 'DBIx::TransactionManager';
requires 'Regexp::Common';
requires 'Regexp::Assemble';
requires 'Text::Diff::FormattedHTML';
requires 'Text::Markdown::Discount';
requires 'Text::Markdown';
requires 'SQL::Interp';
requires 'Carp::Clan';
requires 'JSON';
Expand All @@ -39,5 +39,4 @@ requires 'Log::Minimal';
on 'test' => sub {
requires 'Test2::V0';
requires 'Test::WWW::Mechanize::PSGI';
requires 'Unicode::GCString';
};
Loading

0 comments on commit e108833

Please sign in to comment.