File tree Expand file tree Collapse file tree 2 files changed +41
-5
lines changed
Expand file tree Collapse file tree 2 files changed +41
-5
lines changed Original file line number Diff line number Diff line change 6060
6161WORKDIR /usr/src/josh
6262RUN rustup component add rustfmt
63- RUN rustup target add wasm32-unknown-unknown
6463RUN cargo install --version 0.1.35 cargo-chef
6564RUN cargo install --version 0.2.1 hyper_cgi --features=test-server
6665RUN cargo install --version 0.10.0 graphql_client_cli
6766
6867FROM dev as dev-local
6968
69+ RUN mkdir -p /opt/cache && \
70+ chmod 777 /opt/cache
71+
72+ VOLUME /opt/cache
73+
74+ ENV CARGO_TARGET_DIR=/opt/cache/cargo-target
75+ ENV CARGO_HOME=/opt/cache/cargo-cache
76+ RUN npm config set cache /opt/cache/npm-cache --global
77+
7078FROM dev as dev-ci
7179
7280COPY --from=dev-planner /usr/src/josh/recipe.json .
@@ -96,11 +104,11 @@ apt-get install --yes --no-install-recommends \
96104rm -rf /var/lib/apt/lists/*
97105EOF
98106
99- COPY --from=dev /opt/git-install /opt/git-install
107+ COPY --from=dev --link=false /opt/git-install /opt/git-install
100108ENV PATH=${PATH}:/opt/git-install/bin
101109
102- COPY --from=build /usr/src/josh/target/release/josh-proxy /usr/bin/
103- COPY --from=build /usr/src/josh/run-josh.sh /usr/bin/
104- COPY --from=build /usr/src/josh/static/ /josh/static/
110+ COPY --from=build --link=false /usr/src/josh/target/release/josh-proxy /usr/bin/
111+ COPY --from=build --link=false /usr/src/josh/run-josh.sh /usr/bin/
112+ COPY --from=build --link=false /usr/src/josh/static/ /josh/static/
105113
106114CMD sh /usr/bin/run-josh.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # this script can be used to run tests in the container used for deployement.
4+ # usage:
5+ # Run all tests: ./tester.sh
6+ # Run specific test: ./tester.sh path/to/test.t
7+
8+ set -e
9+ shopt -s extglob
10+ shopt -s inherit_errexit
11+
12+ if (( $# == 0 )) ; then
13+ tests=" tests/{filter{**/,},proxy}/*.t"
14+ else
15+ tests=" $* "
16+ fi
17+
18+ echo " running: $tests "
19+
20+ docker buildx build --target=dev-local -t josh-dev-local .
21+ docker run -it --rm\
22+ --workdir " $( pwd) " \
23+ --volume " $( pwd) " :" $( pwd) " \
24+ --volume cache:/opt/cache\
25+ --user " $( id -u) " :" $( id -g) " \
26+ josh-dev-local\
27+ bash -c " cargo build --workspace --all && sh run-tests.sh $tests "
28+
You can’t perform that action at this time.
0 commit comments