Skip to content

Commit d386cd7

Browse files
committed
Generates a quickstart build details file
Signed-off-by: Dennis Gove <dgove1@bloomberg.net>
1 parent e53e864 commit d386cd7

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
cat << EOF
4+
----------------------------------------
5+
-- Parsec Quickstart Build Details
6+
----------------------------------------
7+
OS: $(cat /build-env/os)
8+
Architecture: $(cat /build-env/arch)
9+
Rust: $(cat /build-env/rustc-version)
10+
Cargo: $(cat /build-env/cargo-version)
11+
12+
----------------------------------------
13+
-- Parsec Service
14+
----------------------------------------
15+
Version: $(cat /build-env/parsec-version)
16+
Commit Hash: $(cat /build-env/parsec-commit)
17+
Dependencies:
18+
$(cat /build-env/parsec-dependencies)
19+
20+
----------------------------------------
21+
-- Parsec Tool
22+
----------------------------------------
23+
Version: $(cat /build-env/parsec-tool-version)
24+
Commit Hash: $(cat /build-env/parsec-tool-commit)
25+
Dependencies:
26+
$(cat /build-env/parsec-tool-dependencies)
27+
28+
EOF

quickstart/quickstart.Dockerfile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ RUN apt update -y && \
99
WORKDIR /build-env
1010
RUN echo "$(uname | awk '{print tolower($0)}')" > /build-env/os
1111
RUN echo "$(arch)" > /build-env/arch
12+
RUN echo "$(rustc --version)" > /build-env/rustc-version
13+
RUN echo "$(cargo --version)" > /build-env/cargo-version
1214

1315
# ---------------------------------------------
1416
# Docker Stage: Temporary stage to help dependency caching
@@ -22,16 +24,18 @@ WORKDIR /parsec-service
2224
# download them each time the builder runs.
2325
RUN cargo fetch
2426

25-
# Save the current parsec version as defined by cargo
26-
RUN echo "$(cargo metadata --format-version=1 --no-deps --offline | jq -r '.packages[0].version')" > /build-env/parsec-version
27-
2827
# ---------------------------------------------
2928
# Docker Stage: Executes the build of the Parsec Service
3029
FROM parsec_service_scratch AS parsec_service_builder
3130

3231
## Run the actual build
3332
RUN cargo build --release --features mbed-crypto-provider
3433

34+
# Save the current parsec version and dependencies as defined by cargo and the current git commit hash
35+
RUN echo "$(cargo metadata --format-version=1 --no-deps --offline | jq -r '.packages[0].version')" > /build-env/parsec-version
36+
RUN echo "$(cargo tree)" > /build-env/parsec-dependencies
37+
RUN echo "$(git rev-parse HEAD)" > /build-env/parsec-commit
38+
3539
# ---------------------------------------------
3640
# Docker Stage: Executes the build of the Parsec Tool
3741
FROM base_builder AS parsec_tool_builder
@@ -59,6 +63,14 @@ WORKDIR /parsec/quickstart
5963
COPY quickstart/config.toml /parsec/quickstart/config.toml
6064
COPY --from=parsec_tool_builder /parsec-tool/tests/parsec-cli-tests.sh /parsec/quickstart/parsec-cli-tests.sh
6165

66+
## Grab all the build-env values
67+
COPY --from=parsec_service_builder /build-env/* /build-env/
68+
COPY --from=parsec_tool_builder /build-env/* /build-env/
69+
70+
## Generate the build details file
71+
COPY quickstart/construct-build-details.sh /build-env/
72+
RUN chmod +x /build-env/construct-build-details.sh && /build-env/construct-build-details.sh > /parsec/quickstart/build.txt
73+
6274
# ---------------------------------------------
6375
# Docker Stage: Constructs an appropriate tarball containing all binaries and files
6476
FROM ubuntu:latest AS tarball_builder

0 commit comments

Comments
 (0)