-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathubuntu.sh
More file actions
executable file
·86 lines (75 loc) · 1.74 KB
/
ubuntu.sh
File metadata and controls
executable file
·86 lines (75 loc) · 1.74 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash
set -eu
source ./_common.sh
source ./_brew.sh
OS_ALIAS="ubuntu"
update_apt() {
sudo apt update
sudo apt full-upgrade -y
sudo apt autoremove -y
sudo apt autoclean -y
}
add_docker_apt_repo() {
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
}
apt_install_pkg() {
local items=()
read_package_file_to_array "$OS_ALIAS" items
[[ ${#items[@]} == 0 ]] && return
echo_gray "found ${#items[@]} apt packages to install"
sudo apt install -y "${items[@]}"
}
bootstrap() {
update_apt
add_docker_apt_repo
apt_install_pkg
install_brew
update_brew
brew_install_pkg "$OS_ALIAS-brew"
install_or_update_rust
install_or_update_aws_cli_linux
install_or_update_aws_sam_cli_linux
# install_gtk_theme
}
post_config_os() {
add_brew_path_to_session
post_config_linux
link_home "bash/linux.sh" ".bashrc"
link_home "zsh/linux.sh" ".zshrc"
}
do_update() {
update_apt
update_brew
install_or_update_rust
install_or_update_aws_cli_linux
install_or_update_aws_sam_cli_linux
}
main() {
if should_config; then
pre_config_generic
post_config_os
return
elif should_update; then
do_update
return
elif should_full; then
pre_config_generic
bootstrap
post_config_os
return
fi
}
set_run_mode "$@"
main