forked from leafo/sightreading.training
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'iss21-fork-rename' into pianistica
- Loading branch information
Showing
76 changed files
with
2,778 additions
and
5,039 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
FROM leafo/lapis-archlinux-itchio:latest | ||
MAINTAINER leaf corcoran <leafot@gmail.com> | ||
FROM archlinux/base:latest AS build_image | ||
|
||
RUN pacman -Sy tup nginx git nodejs-lts-fermium npm sassc python3 python-pip --noconfirm && (yes | pacman -Scc || :) | ||
|
||
WORKDIR /site/pianistica | ||
|
||
# init npm as separate step, for better caching | ||
ADD package.json package.json | ||
ADD package-lock.json package-lock.json | ||
RUN npm install | ||
|
||
WORKDIR /site/sightreading.training | ||
ADD . . | ||
ENTRYPOINT ./ci.sh | ||
|
||
RUN python3 -m pip install -r requirements.txt && \ | ||
tup init && \ | ||
tup generate build.sh && \ | ||
sed -i.bak '2iset -o xtrace' build.sh && \ | ||
./build.sh && \ | ||
rm -r node_modules .tup | ||
|
||
FROM nginx:1.17.6-alpine as final_image | ||
WORKDIR /site/pianistica | ||
COPY --from=build_image /site/pianistica/static /site/pianistica/static | ||
COPY --from=build_image /site/pianistica/serverless /site/pianistica/serverless | ||
COPY --from=build_image /site/pianistica/mime.types /site/pianistica/mime.types | ||
|
||
ENTRYPOINT nginx -c /site/pianistica/serverless/nginx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,5 @@ | ||
|
||
.PHONY: new_migration migrate init_schema test_db lint lint_js checkpoint restore_checkpoint annotate_models | ||
|
||
new_migration: | ||
(echo " [$$(date +%s)]: =>"; echo) >> migrations.moon | ||
|
||
migrate: | ||
lapis migrate | ||
make schema.sql | ||
|
||
schema.sql: | ||
pg_dump -s -U postgres sightreading > schema.sql | ||
pg_dump -a -t lapis_migrations -U postgres sightreading >> schema.sql | ||
|
||
init_schema: | ||
createdb -U postgres sightreading | ||
cat schema.sql | psql -U postgres sightreading | ||
|
||
test_db: | ||
-dropdb -U postgres sightreading_test | ||
createdb -U postgres sightreading_test | ||
pg_dump -s -U postgres sightreading | psql -U postgres sightreading_test | ||
pg_dump -a -t lapis_migrations -U postgres sightreading | psql -U postgres sightreading_test | ||
|
||
lint: | ||
git ls-files | grep '\.moon$$' | grep -v config.moon | xargs -n 100 moonc -l | ||
.PHONY: lint_js | ||
|
||
lint_js: | ||
node_modules/.bin/eslint $$(git ls-files | grep \.es6$$ | grep -v spec) | ||
|
||
checkpoint: | ||
mkdir -p dev_backup | ||
pg_dump -F c -U postgres sightreading > dev_backup/$$(date +%F_%H-%M-%S).dump | ||
|
||
restore_checkpoint: | ||
-dropdb -U postgres sightreading | ||
createdb -U postgres sightreading | ||
pg_restore -U postgres -d sightreading $$(find dev_backup | grep \.dump | sort -V | tail -n 1) | ||
|
||
annotate_models: | ||
lapis annotate $$(find models -type f | grep moon$$) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.