Skip to content

Commit 796d9f5

Browse files
Remove databases from laptop install script. (Shift3#33)
As we do 99% of our development inside of docker containers, installing databases locally just ends up creating more conflicts then it solves (such a port conflicts as such). Once a developer knows docker in and out, and their system in and out, they will be able to manage multiple installs just fine. However out of the box our expected flow is using Docker.
1 parent 49798a1 commit 796d9f5

File tree

3 files changed

+3
-64
lines changed

3 files changed

+3
-64
lines changed

README.md

-10
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,6 @@ Image tools:
8888

8989
[ImageMagick]: https://imagemagick.org/index.php
9090

91-
Databases:
92-
93-
* [Postgres] for storing relational data
94-
* [Redis] for storing key-value data
95-
* [Mongo] for non-relational data
96-
97-
[Postgres]: http://www.postgresql.org/
98-
[Redis]: http://redis.io/
99-
[Mongo]: https://www.mongodb.com/
100-
10191
What It Configures
10292
------------------
10393

os/linux

+3-48
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,22 @@ elif grep -q -i ubuntu <<< $ID || grep -q -i ubuntu <<< $ID_LIKE; then
1111
OS=Debian
1212
DOCKER_APT_REPO="deb [arch=amd64] https://download.docker.com/linux/ubuntu \
1313
bionic stable"
14-
MONGO_APT_REPO="deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu \
15-
bionic/mongodb-org/4.2 multiverse"
1614
elif grep -q -i debian <<< $ID || grep -q -i debian <<< $ID_LIKE; then
1715
OS=Debian
1816
DOCKER_APT_REPO="deb [arch=amd64] https://download.docker.com/linux/debian \
1917
buster stable"
20-
MONGO_APT_REPO="deb http://repo.mongodb.org/apt/debian \
21-
buster/mongodb-org/4.2 main"
2218
fi
2319

2420
SHARED_PACKAGES=$(cat <<EOF
2521
curl git zsh vim tmux httpie vim hub
26-
27-
mongodb-org
2822
EOF
2923
)
3024

3125
DEBIAN_PACKAGES=$(cat <<EOF
3226
$SHARED_PACKAGES
3327
build-essential
3428
35-
postgresql redis-server awscli python3 python3-pip
29+
awscli python3 python3-pip
3630
imagemagick shellcheck gnupg
3731
silversearcher-ag
3832
EOF
@@ -44,49 +38,14 @@ python3 python3-pip
4438
util-linux-user
4539
git-lfs the_silver_searcher
4640
ShellCheck ImageMagick
47-
postgresql-server postgresql-contrib libpq-devel redis awscli
41+
awscli
4842
4943
dnf-plugins-core
5044
5145
openssl-devel
5246
EOF
5347
)
5448

55-
fedora_enable_databases_on_restart() {
56-
fancy_echo "Ensuring databases run on startup."
57-
if sudo bash -c '[ ! -d "/var/lib/pgsql/data" ]'; then
58-
sudo /usr/bin/postgresql-setup --initdb
59-
fi
60-
sudo systemctl enable postgresql
61-
sudo systemctl enable redis
62-
sudo systemctl enable mongod
63-
}
64-
65-
debian_enable_databases_on_restart() {
66-
fancy_echo "Ensuring databases run on startup."
67-
sudo systemctl enable postgresql
68-
sudo systemctl enable redis-server
69-
sudo systemctl enable mongod
70-
}
71-
72-
apt_add_mongo_repo() {
73-
echo "$MONGO_APT_REPO" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
74-
sudo apt install -y -q gnupg wget
75-
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
76-
sudo apt-get update
77-
}
78-
79-
dnf_add_mongo_repo() {
80-
sudo tee /etc/yum.repos.d/mongodb-org-4.2.repo > /dev/null <<EOF
81-
[mongodb-org-4.2]
82-
name=MongoDB Repository
83-
baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/4.2/x86_64/
84-
gpgcheck=1
85-
enabled=1
86-
gpgkey=https://www.mongodb.org/static/pgp/server-4.2.asc
87-
EOF
88-
}
89-
9049
dnf_add_and_install_docker_ce() {
9150
sudo dnf config-manager \
9251
--add-repo \
@@ -109,7 +68,7 @@ deb_add_and_install_docker_ce() {
10968

11069
systemd_enable_docker_on_restart() {
11170
fancy_echo "Ensuring Docker runs on startup."
112-
sudo usermod -aG docker $(whoami)
71+
sudo usermod -aG docker "$(whoami)"
11372
sudo systemctl enable docker
11473
}
11574

@@ -137,22 +96,18 @@ case $OS in
13796
Fedora)
13897
fancy_echo "Installing packages using dnf"
13998
sudo dnf groupinstall -y "C Development Tools and Libraries"
140-
dnf_add_mongo_repo
14199
dnf_add_and_install_terraform
142100
sudo dnf -y install $FEDORA_PACKAGES
143101
install_circleci_cli
144102
install_eb_cli
145-
fedora_enable_databases_on_restart
146103
;;
147104
Debian)
148105
fancy_echo "Installing packages using apt"
149106
deb_add_and_install_docker_ce
150107
deb_add_and_install_terraform
151-
apt_add_mongo_repo
152108
sudo apt install -y -q $DEBIAN_PACKAGES
153109
install_circleci_cli
154110
install_eb_cli
155-
debian_enable_databases_on_restart
156111
systemd_enable_docker_on_restart
157112
;;
158113
*)

os/mac

-6
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ brew update --force # https://github.com/Homebrew/brew/issues/1151
4747

4848
brew bundle --file=- <<EOF
4949
tap "homebrew/services"
50-
tap "mongodb/brew"
5150
5251
# Unix
5352
brew "git"
@@ -78,11 +77,6 @@ brew "libyaml" # should come after openssl
7877
brew "coreutils"
7978
brew "yarn"
8079
cask "gpg-suite"
81-
82-
# Databases
83-
brew "postgres", restart_service: :changed
84-
brew "redis", restart_service: :changed
85-
brew "mongodb-community", restart_service: :changed
8680
EOF
8781

8882
fix_zsh_permissions

0 commit comments

Comments
 (0)