This repository was archived by the owner on Feb 2, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
48 lines (37 loc) · 1.73 KB
/
init.sh
File metadata and controls
48 lines (37 loc) · 1.73 KB
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
#!/bin/bash
# Ubuntu
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update && sudo apt-get install -y --no-install-recommends --no-upgrade \
iptables libnss3-tools ca-certificates sudo curl wget gnupg2 apt-utils zlib1g-dev autoconf build-essential git python-dev \
&& sudo apt-get clean \
&& sudo rm -rf /var/lib/apt/lists/*
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update && sudo apt-get install -y --no-install-recommends --no-upgrade \
google-chrome-stable \
&& sudo apt-get clean \
&& sudo rm -rf /var/lib/apt/lists/*
curl -sL https://deb.nodesource.com/setup_9.x | sudo bash -
sudo apt-get install -y --no-install-recommends --no-upgrade \
nodejs \
&& sudo apt-get clean \
&& sudo rm -rf /var/lib/apt/lists/*
echo "setting up git credentials"
export GIT_CREDENTIALS=$(curl -s -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/creds)
if [[ ${GIT_CREDENTIALS} == *"Error 404"* ]];
then
echo "no GIT_CREDENTIALS passed shutting down"
sudo shutdown now
exit 1
fi
if [[ ! -d /sfe ]]
then
sudo mkdir /sfe
sudo chmod 777 /sfe
fi
echo "${GIT_CREDENTIALS}" | sudo tee /sfe/git-credentials
sudo chmod 777 /sfe/git-credentials
sudo chattr +i /sfe/git-credentials
git config --global credential.helper "store --file=/sfe/git-credentials"
(git -C /sfe/proxy fetch --all && git -C /sfe/proxy reset --hard origin/mock-api) || (sudo rm -rf /sfe/proxy && mkdir /sfe/proxy && git -C /sfe clone --branch mock-api https://github.com/SymphonyOSF/proxy.git proxy)
/sfe/proxy/os_setup/startup.sh