Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
6597cdae
Commit
6597cdae
authored
1 year ago
by
Cédric Moreau
Browse files
Options
Downloads
Patches
Plain Diff
buildplatform
parent
506f77d6
No related branches found
No related tags found
No related merge requests found
Pipeline
#33355
failed
1 year ago
Stage: test_deploy
Stage: quality
Stage: build
Stage: tests
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker/Dockerfile
+24
-25
24 additions, 25 deletions
docker/Dockerfile
with
24 additions
and
25 deletions
docker/Dockerfile
+
24
−
25
View file @
6597cdae
...
@@ -7,8 +7,7 @@ FROM debian:bullseye-slim as target
...
@@ -7,8 +7,7 @@ FROM debian:bullseye-slim as target
# When building for a foreign arch, use cross-compilation
# When building for a foreign arch, use cross-compilation
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
FROM
--platform=$BUILDPLATFORM rust:1-bullseye
as
build
FROM
rust:1-bullseye
as
build
ARG
BUILDPLATFORM
ARG
TARGETPLATFORM
ARG
TARGETPLATFORM
# We need the target arch triplet in both Debian and rust flavor
# We need the target arch triplet in both Debian and rust flavor
...
@@ -33,15 +32,15 @@ RUN if [ "$debug" = 0 ]; then \
...
@@ -33,15 +32,15 @@ RUN if [ "$debug" = 0 ]; then \
echo
"TARGET_FOLDER=debug"
>>
/root/dynenv
;
\
echo
"TARGET_FOLDER=debug"
>>
/root/dynenv
;
\
fi
fi
# Configure cross-build environment if need be
#
# Configure cross-build environment if need be
RUN
set
-x
&&
\
#
RUN set -x && \
if
[
"
$TARGETPLATFORM
"
!=
"
$BUILDPLATFORM
"
]
;
then
\
#
if [ "$TARGETPLATFORM" != "$BUILDPLATFORM" ]; then \
.
/root/dynenv
&&
\
#
. /root/dynenv && \
apt
install
-y
gcc-
$DEBIAN_ARCH_TRIPLET
binutils-
$DEBIAN_ARCH_TRIPLET
&&
\
#
apt install -y gcc-$DEBIAN_ARCH_TRIPLET binutils-$DEBIAN_ARCH_TRIPLET && \
rustup target add
"
$RUST_ARCH_TRIPLET
"
&&
\
#
rustup target add "$RUST_ARCH_TRIPLET" && \
: https://github.com/rust-lang/cargo/issues/4133
&&
\
#
: https://github.com/rust-lang/cargo/issues/4133 && \
echo
"RUSTFLAGS='-C linker=
$DEBIAN_ARCH_TRIPLET
-gcc'; export RUSTFLAGS"
>>
/root/dynenv
;
\
#
echo "RUSTFLAGS='-C linker=$DEBIAN_ARCH_TRIPLET-gcc'; export RUSTFLAGS" >>/root/dynenv; \
fi
#
fi
# Build
# Build
RUN
set
-x
&&
\
RUN
set
-x
&&
\
...
@@ -49,20 +48,20 @@ RUN set -x && \
...
@@ -49,20 +48,20 @@ RUN set -x && \
.
/root/dynenv
&&
\
.
/root/dynenv
&&
\
cargo xtask release-runtime 600
cargo xtask release-runtime 600
# Run tests if requested, expted when cross-building
#
# Run tests if requested, expted when cross-building
ARG
cucumber=0
#
ARG cucumber=0
RUN if
[
"
$cucumber
"
!=
0
]
&&
[
"
$TARGETPLATFORM
"
=
"
$BUILDPLATFORM
"
]
;
then
\
#
RUN if [ "$cucumber" != 0 ] && [ "$TARGETPLATFORM" = "$BUILDPLATFORM" ]; then \
cargo
test
--workspace
--exclude
duniter-end2end-tests
--exclude
duniter-live-tests
&&
\
#
cargo test --workspace --exclude duniter-end2end-tests --exclude duniter-live-tests && \
cargo cucumber
-i
account_creation
*
&&
\
#
cargo cucumber -i account_creation* && \
cargo cucumber
-i
certification
*
&&
\
#
cargo cucumber -i certification* && \
cargo cucumber
-i
identity_creation
*
&&
\
#
cargo cucumber -i identity_creation* && \
cargo cucumber
-i
monetary_mass
*
&&
\
#
cargo cucumber -i monetary_mass* && \
cargo cucumber
-i
oneshot_account
*
&&
\
#
cargo cucumber -i oneshot_account* && \
cargo cucumber
-i
transfer_all
*
&&
\
#
cargo cucumber -i transfer_all* && \
cd
target/debug/deps/
&&
\
#
cd target/debug/deps/ && \
rm
cucumber_tests-
*
.d
&&
\
#
rm cucumber_tests-*.d && \
mv
cucumber_tests
*
../../../build/duniter-cucumber
;
\
#
mv cucumber_tests* ../../../build/duniter-cucumber; \
fi
#
fi
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Final Stage
# Final Stage
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment