You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/build/secrets/platforms-buildrunner.yaml
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,13 @@ steps:
13
13
# RUN --mount=type=secret,id=secret1 \
14
14
# --mount=type=secret,id=secret2 \
15
15
# echo Using secrets in my build - secret1 file located at /run/secrets/secret1 with contents $(cat /run/secrets/secret1) and secret2=$(cat /run/secrets/secret2)
16
-
# Using secrets in environment variables
17
16
RUN --mount=type=secret,id=secret1 \
18
-
--mount=type=secret,id=secret2 \
19
-
SECRET1_FILE=/run/secrets/secret1 \
20
-
SECRET2_VARIABLE=$(cat /run/secrets/secret2) \
21
-
&& echo Using secrets in my build - secret1 file located at $SECRET1_FILE with contents $(cat $SECRET1_FILE) and secret2=$SECRET2_VARIABLE
17
+
--mount=type=secret,id=secret2 \
18
+
sh -c ' \
19
+
SECRET1_FILE=/run/secrets/secret1; \
20
+
SECRET2_VARIABLE=$(cat /run/secrets/secret2); \
21
+
echo "Using secrets in my build - secret1 file located at $SECRET1_FILE with contents $(cat $SECRET1_FILE) and secret2=$SECRET2_VARIABLE" \
0 commit comments