-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: isolated Linux testing, release builds
Currently, running some of the tests can be problematic if SIT is also being used on that same machine by the same user as SIT will try to pick up the existing user config. Also, building releases requires the additional setup of musl target. Solution: provide a Docker container with the musl build environment
- Loading branch information
Showing
4 changed files
with
23 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ target | |
.idea | ||
.sit/items/*/.lock | ||
._docker_osx | ||
._docker_linux |
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,7 +1,14 @@ | ||
osx: target/x86_64-apple-darwin/release/sit target/x86_64-apple-darwin/release/sit-web | ||
linux: target/x86_64-unknown-linux-musl/release/sit target/x86_64-unknown-linux-musl/release/sit-web | ||
|
||
target/x86_64-apple-darwin/release/sit target/x86_64-apple-darwin/release/sit-web: build-tools/cross-compile-osx/Dockerfile sit-core sit-web sit | ||
docker build --iidfile ._docker_osx build-tools/cross-compile-osx | ||
sed -i s/sha256://g ._docker_osx | ||
docker run -u `id -u`:`id -g` -v `pwd`:/sit -w /sit -t `cat ._docker_osx` sh -c "cargo build --release --target=x86_64-apple-darwin" | ||
rm -f ._docker_osx | ||
|
||
target/x86_64-unknown-linux-musl/release/sit target/x86_64-unknown-linux-musl/release/sit-web: build-tools/linux-build-container/Dockerfile sit-core sit-web sit | ||
docker build --iidfile ._docker_linux build-tools/linux-build-container | ||
sed -i s/sha256://g ._docker_linux | ||
docker run -u `id -u`:`id -g` -v `pwd`:/sit -w /sit -t `cat ._docker_linux` sh -c "cargo build --release --target=x86_64-unknown-linux-musl && strip target/x86_64-unknown-linux-musl/release/sit target/x86_64-unknown-linux-musl/release/sit-web" | ||
rm -f ._docker_linux |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM rust:1.26.2 | ||
RUN apt-get update && apt-get install -y cmake libgit2-dev musl-tools | ||
RUN rustup target add x86_64-unknown-linux-musl |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
This container provides a convenient way to build and test sit in isolation | ||
from the local environment (Linux-specific). This is particularly useful for | ||
running integration tests that might inadvertently read user configuration and | ||
fail because of that (or introduce undesired behaviour such as requiring gnupg | ||
signatures and triggering gpg-agent popups) ir building releases. | ||
|
||
A suggested way to run such isolated environment would be: | ||
|
||
``` | ||
docker run -v /host/path/to/sit/repo:/sit -e CARGO_TARGET_DIR=/sit/test_target -ti <image tag> | ||
``` | ||
|