generated from EmbarkStudios/opensource-template
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathentrypoint.sh
executable file
·59 lines (49 loc) · 1.41 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh -l
set -e
PATH=$PATH:/usr/local/cargo/bin
if [ -n "$1" ]
then
rustup set profile minimal
rustup default "$1"
else
# Ensure active toolchain is installed if explicit rust-version is not passed.
# Starting with v1.28, rustup is not going to install active toolchain by default,
# and this is needed to install the active toolchain if it's not installed.
# See https://blog.rust-lang.org/2025/03/02/Rustup-1.28.0.html#whats-new-in-rustup-1280
rustup show active-toolchain || rustup toolchain install
fi
if [ -n "$2" ]
then
git config --global credential.helper store
git config --global --replace-all url.https://github.com/.insteadOf ssh://[email protected]/
git config --global --add url.https://github.com/.insteadOf [email protected]:
echo "$2" > "$HOME/.git-credentials"
chmod 600 "$HOME/.git-credentials"
fi
if [ -n "$3" ]
then
mkdir -p "/root/.ssh"
chmod 0700 "/root/.ssh"
echo "${3}" > "/root/.ssh/id_rsa"
chmod 0600 "/root/.ssh/id_rsa"
fi
if [ -n "$4" ]
then
mkdir -p "/root/.ssh"
chmod 0700 "/root/.ssh"
echo "${4}" > "/root/.ssh/known_hosts"
chmod 0600 "/root/.ssh/known_hosts"
fi
if [ -n "$5" ]
then
export CARGO_NET_GIT_FETCH_WITH_CLI="$5"
fi
shift
shift
shift
shift
shift
# Due to how github actions run containers we need to explicitly force colors
# as TTY detection fails inside them
export CARGO_TERM_COLOR="always"
cargo-deny $*