7 changed files with 67 additions and 7 deletions
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
|
||||
FROM moparisthebest/self-ci-base:latest |
||||
|
||||
# set CROSS_DOCKER_IN_DOCKER to inform `cross` that it is executed from within a container |
||||
#ENV CROSS_DOCKER_IN_DOCKER=true |
||||
|
||||
RUN mkdir /cargo && ln -sf /cargo/ /root/.cargo && \ |
||||
pacman -Syu --noconfirm --needed docker rustup gcc && \ |
||||
rustup install stable && rustup default stable && \ |
||||
cargo install --root / cross |
||||
|
||||
COPY ./build.sh /usr/bin/ |
||||
|
||||
VOLUME [ "/build", "/var/run/docker.sock" ] |
||||
|
||||
WORKDIR /build |
||||
ENTRYPOINT ["/usr/bin/run.sh"] |
||||
CMD ["/usr/bin/build.sh", "./.jenkins/build.sh"] |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash |
||||
set -euo pipefail |
||||
|
||||
for TARGET in ${BUILD_TARGETS:-x86_64-unknown-linux-musl} |
||||
do |
||||
TARGET="$TARGET" "$@" |
||||
done |
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
self-ci-rust |
||||
------------ |
||||
|
||||
A docker container with rustup and [cross](https://github.com/rust-embedded/cross) that runs a script with every variant cross supports. |
||||
|
||||
Meant to be ran in CI something like this: |
||||
|
||||
```sh |
||||
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$PWD:/build" -e BRANCH_NAME -e BUILD_UID=$UID -e BUILD_GID=$(id -g) moparisthebest/self-ci-rust:latest |
||||
``` |
||||
|
||||
Without arguments it will execute `.jenkins/build.sh` once for each docker container cross supports, setting the env variables TARGET and DISABLE_TESTS appropriately so invocations of `cross` and `cargo` *just work*. If you want to call another script each time: |
||||
|
||||
```sh |
||||
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$PWD:/build" -e BRANCH_NAME -e BUILD_UID=$UID -e BUILD_GID=$(id -g) moparisthebest/self-ci-rust:latest build.sh ./path/to/your/script.sh |
||||
``` |
Loading…
Reference in new issue