generated from EmbarkStudios/opensource-template
-
Notifications
You must be signed in to change notification settings - Fork 34
/
entrypoint.sh
executable file
·53 lines (43 loc) · 1.01 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
#!/bin/sh -l
set -e
PATH=$PATH:/usr/local/cargo/bin
if [ -n "$1" ]
then
rustup set profile minimal
rustup default "$1"
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 $*