generated from EmbarkStudios/opensource-template
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathentrypoint.sh
executable file
·47 lines (36 loc) · 1.12 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
#!/bin/bash
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://git@github.com/
git config --global --add url.https://github.com/.insteadOf git@github.com:
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 5
# Due to how github actions run containers we need to explicitly force colors
# as TTY detection fails inside them
export CARGO_TERM_COLOR="always"
# Workaround for rustup 1.28 completely breaking rust-toolchain.toml
(cd "$(dirname "$4")"; rustup show || rustup toolchain install)
cargo-deny $*