Skip to content

Commit 7bbba4e

Browse files
committed
editoast: assets: do not commit sprites assets
They are now built either during the docker build Or must be generated by hand as described in the readme Signed-off-by: Tristram Gräbener <[email protected]>
1 parent 0ffe831 commit 7bbba4e

14 files changed

+38
-820
lines changed

editoast/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
target
22
*.snap.new
3+
assets/sprites/*/sprites.*

editoast/Dockerfile

+11-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ FROM chef AS base_builder
1818
RUN apk add --no-cache build-base openssl openssl-dev openssl-libs-static mold libpq-dev geos-dev
1919
ENV RUSTFLAGS="-C target-feature=-crt-static -C link-arg=-fuse-ld=mold"
2020
RUN cargo install diesel_cli --no-default-features --features postgres
21-
COPY --from=static_assets . /assets
21+
COPY --from=static_assets . /assets
22+
23+
#######################
24+
# Build assets #
25+
#######################
26+
FROM alpine:latest AS editoast_assets
27+
RUN wget https://github.com/flother/spreet/releases/download/v0.11.0/spreet-x86_64-unknown-linux-musl.tar.gz
28+
RUN tar xvf spreet-x86_64-unknown-linux-musl.tar.gz --directory /usr/bin
29+
COPY ./assets /assets
30+
RUN /assets/sprites/generate-atlas.sh
2231

2332
######################
2433
# Testing env: build #
@@ -61,7 +70,7 @@ RUN apk add --no-cache jemalloc curl ca-certificates geos libpq openssl postgres
6170
COPY --from=run_builder /usr/local/cargo/bin/editoast /usr/local/bin/editoast
6271
COPY --from=run_builder /usr/local/cargo/bin/diesel /usr/local/bin/diesel
6372
COPY --from=run_builder /editoast/migrations /migrations
64-
COPY --from=run_builder /editoast/assets /assets
73+
COPY --from=editoast_assets /assets /assets
6574

6675
ARG OSRD_GIT_DESCRIBE
6776
ENV OSRD_GIT_DESCRIBE=${OSRD_GIT_DESCRIBE}

editoast/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ For both tests or run:
2121
# apply database migration
2222
$ cargo install diesel_cli --no-default-features --features postgres
2323
$ diesel migration run
24+
# build the assets
25+
$ cargo install spreet
26+
$ ./assets/sprites/generate-atlas.sh
2427
# Build and run
2528
$ cargo build
2629
$ cargo run -- runserver

editoast/assets/sprites/BAL/sprites.json

-79
This file was deleted.
-8.98 KB
Binary file not shown.

editoast/assets/sprites/BAPR/sprites.json

-93
This file was deleted.
-9.96 KB
Binary file not shown.

editoast/assets/sprites/TVM300/sprites.json

-9
This file was deleted.
-387 Bytes
Binary file not shown.

editoast/assets/sprites/TVM430/sprites.json

-9
This file was deleted.
-387 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)