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: scripts/dev-bootstrap-linux.sh
+31-4Lines changed: 31 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ prereqsoption="yes"
15
15
# docker_mode either "native" or "desktop" (Docker Desktop). Only support "native" currently.
16
16
docker_mode="native"
17
17
# the 'just' install can't be run as root. Switch to 'standard_user' for that:
18
-
standard_user="ubuntu"
18
+
standard_user="${SHELL_USER:-ubuntu}"
19
19
20
-
# On Linux, there are two ways to run Docker. Either the standard native docker installation, or Docker Desktop, which runs inside a virtual machine. The most common installation is standard docker, so that is what is supported by this script currently. In the future, Docker Desktop support could be added. Each method has pros and cons. It's important that the user inside the Django containers is the same as the user on the host machine outside the containers, so that file ownership matches up. Since the user is 'root' inside the containers, it should be 'root' on the host machine. Therefore, any development work should be done as 'root'. That means, run 'sudo su -' before using docker-compose. Docker Desktop would be an alternative to that requirement, and allow running as a regular user account. But with some downside, that it is not a typical linux Docker installation as found on servers.
20
+
# On Linux, there are two ways to run Docker. Either the standard native docker installation, or Docker Desktop, which runs inside a virtual machine. The most common installation is standard docker, so that is what is supported by this script currently. In the future, Docker Desktop support could be added. Each method has pros and cons. It's important that the user inside the Django containers is the same as the user on the host machine outside the containers, so that file ownership matches up. Since the user is 'root' inside the containers, it should be 'root' on the host machine. Therefore, any development work should be done as 'root'. That means, run 'sudo su -' before using docker-compose. Docker Desktop would be an alternative to that requirement, and allow running as a regular user account. But with some downside, that it is not a typical linux Docker installation as found on servers.
21
21
22
22
if [[ ${docker_mode}=="native" ]];then
23
23
repo_path_base="/opt/github"
@@ -27,6 +27,12 @@ if [[ ${docker_mode} == "native" ]]; then
27
27
fi
28
28
completion_message_1="When doing development work, always switch to the root user, cd to that directory location, and run 'docker compose up -d'. You should be root when running docker compose."
29
29
shell_initialization_file=/root/.bashrc
30
+
if id "$standard_user">/dev/null 2>&1;then
31
+
true
32
+
else
33
+
echo"The script needs to be informed about a standard non-root user for certain commands. Those can be discovered by listing 'ls -al /home'. Then please run 'export SHELL_USER=__'. Exiting."
34
+
exit 1
35
+
fi
30
36
fi
31
37
if [[ ${docker_mode}=="desktop" ]];then
32
38
repo_path_base="${HOME}/github"
@@ -156,14 +162,22 @@ fi
156
162
157
163
if [[ "$prereqsoption"=="yes" ]];then
158
164
159
-
# sudo apt-get update
165
+
sudo apt-get update
166
+
167
+
if! cargo --version &> /dev/null
168
+
then
169
+
echo"Installing cargo"
170
+
sudo apt-get install -y cargo
171
+
fi
172
+
160
173
x="\$nrconf{restart} = 'a';"
174
+
mkdir -p /etc/needrestart/conf.d
161
175
echo"$x"| sudo tee /etc/needrestart/conf.d/90-autorestart.conf 1>/dev/null
echo"deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main"| sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
0 commit comments