Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update installation scripts #16

Merged
merged 308 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
308 commits
Select commit Hold shift + click to select a range
105066c
test mac os script
rowah Sep 1, 2024
24413c5
debug macos script
rowah Sep 1, 2024
0894332
debug
rowah Sep 1, 2024
49ad8bc
debug postgres error
rowah Sep 1, 2024
e326857
try older postgres version
rowah Sep 1, 2024
7e2da20
install and start posgres using brew
rowah Sep 1, 2024
f449283
fix ci error
rowah Sep 1, 2024
1f2b89f
initialize database
rowah Sep 1, 2024
7f48b94
debug db path
rowah Sep 1, 2024
04652ca
reload shell
rowah Sep 2, 2024
58e675c
reload shell before starting database
rowah Sep 2, 2024
d90842b
auto detect current shell on linux
rowah Sep 2, 2024
593e346
refactor code
rowah Sep 2, 2024
799de8e
debug macOS script
rowah Sep 2, 2024
4802344
debug shell autodetection
rowah Sep 3, 2024
51818a8
debug shell autodetection
rowah Sep 3, 2024
faf36c4
temp remove Markfile db commands
rowah Sep 4, 2024
77fe7ed
initialise new db cluster and starts server
rowah Sep 4, 2024
7ca08e1
auto detect user current shell
rowah Sep 5, 2024
0632200
fix syntax errors on scripts
rowah Sep 9, 2024
46bab10
use default bash shell
rowah Sep 9, 2024
bce9a86
use postgres 15.1 on linux
rowah Sep 9, 2024
0505527
debug
rowah Sep 9, 2024
d19a0b8
debug
rowah Sep 9, 2024
5e0abdc
debug
rowah Sep 9, 2024
ca20556
debug
rowah Sep 9, 2024
e5fb7fd
revert
rowah Sep 9, 2024
289a378
remove unnecesary software
rowah Sep 9, 2024
173d51e
remove homebrew
rowah Sep 9, 2024
dd1ad36
debug PATH
rowah Sep 9, 2024
8b58603
debug phoenix version
rowah Sep 9, 2024
0bfdbb5
remove zsh
rowah Sep 9, 2024
65b1d52
debug
rowah Sep 9, 2024
57503c6
debug
rowah Sep 9, 2024
49dac94
debug
rowah Sep 9, 2024
386a6c1
revert to zsh
rowah Sep 10, 2024
c00e0f2
debug
rowah Sep 10, 2024
435a909
debug shell detection
rowah Sep 10, 2024
a7d5f4a
Debug
amos-kibet Sep 10, 2024
582d8e2
Debug
amos-kibet Sep 10, 2024
0640554
Debug
amos-kibet Sep 10, 2024
c7a6f8b
Use Zsh for Linux in CI
amos-kibet Sep 10, 2024
9537564
Debug
amos-kibet Sep 10, 2024
2d430eb
Debug
amos-kibet Sep 10, 2024
b5b438a
SSH into the GA runner
amos-kibet Sep 10, 2024
3cda8be
SSH into the GA runner
amos-kibet Sep 10, 2024
9a3282a
Debug
amos-kibet Sep 10, 2024
2f2f48b
Debug
amos-kibet Sep 10, 2024
87695b5
Debug
amos-kibet Sep 10, 2024
cb64fd1
Update tools
amos-kibet Sep 10, 2024
2495089
Debug
amos-kibet Sep 10, 2024
8f18839
Attempt to autodetect current shell
amos-kibet Sep 10, 2024
c7b65e0
Debug
amos-kibet Sep 10, 2024
af1bece
Debug
amos-kibet Sep 10, 2024
ec69a7d
Use Zsh on CI
amos-kibet Sep 10, 2024
87c297d
Debug
amos-kibet Sep 10, 2024
4a86b5b
Debug
amos-kibet Sep 10, 2024
090563b
Revert shell autodetection
amos-kibet Sep 10, 2024
6fe4b7f
Revert shell autodetection
amos-kibet Sep 10, 2024
dd653f6
debug
rowah Sep 16, 2024
4357350
extract software version into variables
rowah Sep 16, 2024
d2cdc77
detect current shell on Linux
rowah Sep 16, 2024
427cff5
use bash shell for workflow
rowah Sep 16, 2024
e8cf3b5
debug
rowah Sep 16, 2024
f674143
debug
rowah Sep 16, 2024
4e76ba7
debug pg installation
rowah Sep 16, 2024
6c3fdd1
export pg data
rowah Sep 16, 2024
4843832
debug
rowah Sep 16, 2024
986a969
debug
rowah Sep 16, 2024
c938e50
debug
rowah Sep 16, 2024
cec3fb8
debug
rowah Sep 16, 2024
4a2e03b
debug
rowah Sep 16, 2024
397bce0
debug
rowah Sep 16, 2024
7ccd1ca
debug
rowah Sep 16, 2024
47c2328
debug
rowah Sep 16, 2024
5266e7f
debug
rowah Sep 16, 2024
5e77dda
debug
rowah Sep 16, 2024
4dfb372
Debug
almirsarajcic Sep 16, 2024
2ecd19e
Debug
almirsarajcic Sep 16, 2024
49555a7
Debug
almirsarajcic Sep 16, 2024
04cbac5
Try again
almirsarajcic Sep 16, 2024
b9a977d
Try again
almirsarajcic Sep 16, 2024
ee8865e
Try again
almirsarajcic Sep 16, 2024
d1bbd7f
Debug
almirsarajcic Sep 16, 2024
0ab6f40
Try again
almirsarajcic Sep 16, 2024
18ab40c
Try again
almirsarajcic Sep 16, 2024
46677f6
Try again
almirsarajcic Sep 16, 2024
dc3cc83
Debug
almirsarajcic Sep 16, 2024
dd25f33
Force usage of Zsh in GitHub Actions
almirsarajcic Sep 16, 2024
5254afe
Try again
almirsarajcic Sep 16, 2024
230cdd5
Try again
almirsarajcic Sep 16, 2024
2ec40df
Try again
almirsarajcic Sep 16, 2024
72a2394
Debug
almirsarajcic Sep 16, 2024
489b832
Debug
almirsarajcic Sep 16, 2024
2dc07d6
Debug
almirsarajcic Sep 16, 2024
e86e91c
Debug
almirsarajcic Sep 16, 2024
1324c34
Debug
almirsarajcic Sep 17, 2024
1ff8ba8
Try again
almirsarajcic Sep 17, 2024
9c29be5
Debug
almirsarajcic Sep 17, 2024
b672c64
Try again
almirsarajcic Sep 17, 2024
dbae11a
Try again
almirsarajcic Sep 17, 2024
dd94fbe
Debug some more
almirsarajcic Sep 17, 2024
c778c42
Try again
almirsarajcic Sep 17, 2024
532c91f
Try again
almirsarajcic Sep 17, 2024
edfd6d7
Try again
almirsarajcic Sep 17, 2024
54b89d9
Try again
almirsarajcic Sep 17, 2024
99c4b42
Try again
almirsarajcic Sep 17, 2024
430cef4
Try again
almirsarajcic Sep 17, 2024
02d6e1a
Try again
almirsarajcic Sep 17, 2024
416ffa6
Try again
almirsarajcic Sep 17, 2024
81541a9
Try again
almirsarajcic Sep 17, 2024
40cf854
Check if it still works
almirsarajcic Sep 17, 2024
2a49dbb
Try again
almirsarajcic Sep 17, 2024
3d5068e
Try again
almirsarajcic Sep 17, 2024
eae491f
Try again
almirsarajcic Sep 17, 2024
cc51945
Check again
almirsarajcic Sep 17, 2024
7e0d1b2
Check CI
almirsarajcic Sep 17, 2024
76234f8
Fix asdf installation for ZSH
almirsarajcic Sep 17, 2024
65408f1
Reduce diff
almirsarajcic Sep 17, 2024
605de42
Fix asdf installation
almirsarajcic Sep 17, 2024
a80c979
Fix image building
almirsarajcic Sep 17, 2024
df54c0d
Switch to mise
almirsarajcic Sep 17, 2024
a2469f8
Try again
almirsarajcic Sep 17, 2024
2c79795
Try again
almirsarajcic Sep 17, 2024
502fe82
Test different shells
almirsarajcic Sep 17, 2024
2e82c4a
🤦
almirsarajcic Sep 17, 2024
85beefb
Fix workflows
almirsarajcic Sep 17, 2024
70ea194
Use power of Elixir instead of matrix
almirsarajcic Sep 17, 2024
3e7d7f8
Try again
almirsarajcic Sep 17, 2024
48a2ffb
Debug
almirsarajcic Sep 17, 2024
6c53c61
Try again
almirsarajcic Sep 17, 2024
146ecb4
Try again
almirsarajcic Sep 17, 2024
acbc74e
Try again
almirsarajcic Sep 17, 2024
1dce9ad
Try again
almirsarajcic Sep 17, 2024
65130df
Try again
almirsarajcic Sep 17, 2024
6d40c7d
Debug
almirsarajcic Sep 17, 2024
75856e6
Try again
almirsarajcic Sep 17, 2024
9e1c19d
Debug
almirsarajcic Sep 17, 2024
40f6e5e
Debug
almirsarajcic Sep 17, 2024
2c1bf03
Try again
almirsarajcic Sep 17, 2024
63d63b5
Try again
almirsarajcic Sep 17, 2024
b1e0aa3
-.-
almirsarajcic Sep 17, 2024
98df698
Fix typo
almirsarajcic Sep 17, 2024
9ce26d3
Debug
almirsarajcic Sep 17, 2024
6a932ca
Try again
almirsarajcic Sep 17, 2024
ef5cf5b
Debug
almirsarajcic Sep 17, 2024
6f4fe10
Debug
almirsarajcic Sep 17, 2024
c28e0a7
Try fixing zsh
almirsarajcic Sep 17, 2024
2d8398f
Try again
almirsarajcic Sep 17, 2024
d7b173a
Try again
almirsarajcic Sep 17, 2024
8eb7fe1
Debug
almirsarajcic Sep 17, 2024
52fcaba
Try again
almirsarajcic Sep 17, 2024
2b48435
Try again
almirsarajcic Sep 17, 2024
741fe55
Debug
almirsarajcic Sep 17, 2024
2d4936d
Debug
almirsarajcic Sep 17, 2024
d81e3fd
Debug
almirsarajcic Sep 17, 2024
7f60c43
Try again
almirsarajcic Sep 17, 2024
b1bfe10
Remove upterm
almirsarajcic Sep 17, 2024
f23326a
Remove fish
almirsarajcic Sep 17, 2024
f24d032
Debug
almirsarajcic Sep 17, 2024
3e3cb9a
Try again
almirsarajcic Sep 17, 2024
ce00a52
Debug
almirsarajcic Sep 17, 2024
ed0a988
Try again
almirsarajcic Sep 17, 2024
45d21d6
Debug
almirsarajcic Sep 17, 2024
73ab07d
Debug
almirsarajcic Sep 17, 2024
694eb14
Debug
almirsarajcic Sep 17, 2024
089b698
Try again
almirsarajcic Sep 17, 2024
c16479a
Try again
almirsarajcic Sep 17, 2024
8a6d916
Try again
almirsarajcic Sep 17, 2024
c59cc7f
Debug
almirsarajcic Sep 17, 2024
87bf09b
Try again
almirsarajcic Sep 17, 2024
c3aa50f
Debug
almirsarajcic Sep 17, 2024
cc7be33
Try again
almirsarajcic Sep 18, 2024
ee548b8
Switch back to asdf
almirsarajcic Sep 18, 2024
948d27d
Try again
almirsarajcic Sep 18, 2024
ba8e2d3
Fix invalid argument error
almirsarajcic Sep 18, 2024
a6787ad
Try again
almirsarajcic Sep 18, 2024
8b66ff1
Fix inconsistencies
almirsarajcic Sep 18, 2024
a69d116
Fix asdf installation on macOS
almirsarajcic Sep 18, 2024
754c720
Enable easier debugging in CI
almirsarajcic Sep 18, 2024
37fc2be
Switch to mise
almirsarajcic Sep 18, 2024
353a46c
Fix setup
almirsarajcic Sep 18, 2024
21bd378
Debug
almirsarajcic Sep 18, 2024
e125c50
Try again
almirsarajcic Sep 18, 2024
f18dbbc
Try again
almirsarajcic Sep 18, 2024
c001fb5
Try again
almirsarajcic Sep 18, 2024
ea2511a
Try again
almirsarajcic Sep 18, 2024
0b1ff6b
Try alternative
almirsarajcic Sep 18, 2024
aee480c
Try again
almirsarajcic Sep 18, 2024
904a772
Try again
almirsarajcic Sep 18, 2024
5f341cb
Try again
almirsarajcic Sep 18, 2024
00e92c1
Try again
almirsarajcic Sep 18, 2024
8eb9745
Try again
almirsarajcic Sep 18, 2024
d2089c6
Try again
almirsarajcic Sep 18, 2024
ef3b2e7
Try again
almirsarajcic Sep 18, 2024
e7d6195
Fix Erlang installation
almirsarajcic Sep 18, 2024
caf3c80
Try again
almirsarajcic Sep 18, 2024
c0fca1b
Debug
almirsarajcic Sep 18, 2024
422857a
Debug
almirsarajcic Sep 18, 2024
2daa146
Try again
almirsarajcic Sep 18, 2024
401a709
Debug
almirsarajcic Sep 18, 2024
0a7769d
Try again
almirsarajcic Sep 18, 2024
c8cab0c
Try again
almirsarajcic Sep 18, 2024
e26d151
Try again
almirsarajcic Sep 18, 2024
815700a
Try again
almirsarajcic Sep 18, 2024
3521cc4
Try again
almirsarajcic Sep 18, 2024
0c123df
Try again
almirsarajcic Sep 18, 2024
5cb007b
Debug
almirsarajcic Sep 18, 2024
25b6a59
Debug
almirsarajcic Sep 18, 2024
07ca725
Try again
almirsarajcic Sep 18, 2024
cd9522b
Try again
almirsarajcic Sep 18, 2024
00fdb69
Try again
almirsarajcic Sep 18, 2024
0f88f0b
Try again
almirsarajcic Sep 18, 2024
ffd2b9b
Try again
almirsarajcic Sep 18, 2024
d447270
Try again
almirsarajcic Sep 18, 2024
7ca02b9
Try again
almirsarajcic Sep 18, 2024
7aa744c
Try again (env)
almirsarajcic Sep 18, 2024
5c47c85
Try again
almirsarajcic Sep 18, 2024
6bd4108
Source
almirsarajcic Sep 18, 2024
48641e2
Be more desperate
almirsarajcic Sep 18, 2024
c78c16e
Make scripts consistent
almirsarajcic Sep 18, 2024
3db710c
Fix running in zsh shell
almirsarajcic Sep 18, 2024
8b53f90
Fix mise installation
almirsarajcic Sep 18, 2024
99e97e1
Fix zsh
almirsarajcic Sep 18, 2024
acfa198
Try again
almirsarajcic Sep 18, 2024
3bcb1ed
Try again
almirsarajcic Sep 18, 2024
3e836fd
Try again
almirsarajcic Sep 18, 2024
ea63ac4
Try again
almirsarajcic Sep 18, 2024
8c6e65c
Fix syntax errors
almirsarajcic Sep 18, 2024
8bd7d46
Fix shell detection in Makefile
almirsarajcic Sep 18, 2024
effd281
Improve POSIX-compatibility
almirsarajcic Sep 18, 2024
cfd8513
Improve it further
almirsarajcic Sep 18, 2024
98c8fd8
Debug
almirsarajcic Sep 18, 2024
dd36aed
Try again
almirsarajcic Sep 18, 2024
8de497c
Try again
almirsarajcic Sep 18, 2024
b8008fa
Try again
almirsarajcic Sep 18, 2024
0df42c3
Try again
almirsarajcic Sep 18, 2024
f6f74c4
Let's go
almirsarajcic Sep 18, 2024
4bff62d
Debug
almirsarajcic Sep 18, 2024
41e2b21
Try again
almirsarajcic Sep 18, 2024
59eb02d
Try again
almirsarajcic Sep 18, 2024
bb8719f
Remove extra instructions
almirsarajcic Sep 18, 2024
fadc3fa
Try again
almirsarajcic Sep 18, 2024
d7d5445
Try again
almirsarajcic Sep 18, 2024
d5ab25b
Forgot something
almirsarajcic Sep 18, 2024
c708c13
Now try the full setup
almirsarajcic Sep 18, 2024
745f92d
Fix installation outside of CI
almirsarajcic Sep 18, 2024
9a8fdd7
Improve instructions for variable shell
almirsarajcic Sep 18, 2024
8cfb6dc
Remove debugging code
almirsarajcic Sep 18, 2024
f9bf4ab
Avoid unnecessary questions
almirsarajcic Sep 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[env]
_.file = '.env'
_.file = '.env.sample'
almirsarajcic marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
elixir 1.17.1-otp-27
erlang 27.0
elixir 1.17.2-otp-27
erlang 27.0.1
almirsarajcic marked this conversation as resolved.
Show resolved Hide resolved
nodejs 20.14.0
120 changes: 30 additions & 90 deletions priv/static/Linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,27 @@ bblue='\033[1;34m'
white='\033[0;37m'
green='\033[0;32m'
cyan='\033[0;36m'
current_shell=$(echo $SHELL | awk -F '/' '{print $NF}')

case "$current_shell" in
"bash"|"rbash")
config_file="$HOME/.bashrc"
;;
"fish")
config_file="$HOME/.config/fish/config.fish"
;;
"dash")
config_file="$HOME/.profile"
;;
"zsh")
config_file="$HOME/.zshrc"
;;
*)
echo "Unsupported shell: $current_shell"
exit 1
;;
esac


function already_installed() {
case $1 in
Expand Down Expand Up @@ -53,18 +74,6 @@ function already_installed() {
"PostgreSQL")
which pg_ctl >/dev/null 2>&1
;;
"Chrome")
dpkg -l | grep -q google-chrome-stable
;;
"Node.js")
which node >/dev/null 2>&1
;;
"ChromeDriver")
npm list -g | grep -q chromedriver
;;
"Docker")
which docker >/dev/null 2>&1
;;
*)
echo "Invalid name argument on checking"
;;
Expand Down Expand Up @@ -106,62 +115,33 @@ function install() {
sudo apt-get update
sudo apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils libncurses-dev openjdk-11-jdk
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf install erlang 27.0
asdf global erlang 27.0
asdf reshim erlang 27.0
asdf install erlang 27.0.1
asdf global erlang 27.0.1
asdf reshim erlang 27.0.1
;;
"Elixir")
asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir 1.17.1-otp-27
asdf global elixir 1.17.1-otp-27
asdf reshim elixir 1.17.1-otp-27
asdf install elixir 1.17.2-otp-27
asdf global elixir 1.17.2-otp-27
asdf reshim elixir 1.17.2-otp-27
;;
"Phoenix")
source ~/.zshrc >/dev/null 2>&1
mix local.hex --force
mix archive.install --force hex phx_new 1.7.0-rc.3
mix archive.install --force hex phx_new 1.7.14
;;
"PostgreSQL")
sudo apt-get update
sudo apt-get -y install linux-headers-generic build-essential libssl-dev libreadline-dev zlib1g-dev libcurl4-openssl-dev uuid-dev icu-devtools

asdf plugin add postgres https://github.com/smashedtoatoms/asdf-postgres.git
asdf install postgres 15.1
asdf global postgres 15.1
asdf install postgres 16.0
asdf global postgres 16.0
asdf reshim postgres

echo 'pg_ctl() { "$HOME/.asdf/shims/pg_ctl" "$@"; }' >>~/.profile
source ~/.zshrc >/dev/null 2>&1
;;
"Chrome")
sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install -y ./google-chrome-stable_current_amd64.deb
;;
"Node.js")
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf install nodejs 20.14.0
asdf global nodejs 20.14.0
asdf reshim nodejs 20.14.0
;;
"ChromeDriver")
source ~/.zshrc >/dev/null 2>&1
npm install -g chromedriver
;;
"Docker")
sudo apt-get update
sudo apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >/dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
;;
*)
echo "Invalid name argument on install"
;;
Expand Down Expand Up @@ -224,24 +204,6 @@ function add_env() {
sleep 1.5
maybe_install "PostgreSQL"

if [[ "$1" =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo -e "${white}"
sleep 3
maybe_install "Chrome"
echo -e "${white}"

sleep 1.5
maybe_install "Node.js"
echo -e "${white}"

sleep 2
maybe_install "ChromeDriver"
echo -e "${white}"

maybe_install "Docker"
echo -e "${white}"
fi

echo -e "${white}"
echo -e "${cyan}${bold}phx.tools setup is complete!"
echo -e "${cyan}${bold}Please restart the terminal and type in the following command:"
Expand Down Expand Up @@ -330,28 +292,6 @@ while ! is_yn "$answer"; do
echo ""
case "$answer" in
[yY] | [yY][eE][sS])
echo -e "${bblue}${bold}We can also install some optional tools:"

echo -e "${cyan}${bold}"

echo "1) Chrome"
echo "2) Node.js"
echo "3) ChromeDriver"
echo "4) Docker"

echo -e "${white}"
echo -e "${white} ${bold}"

optional=""

while ! is_yn "$optional"; do
read -p "Do you want us to install those as well? (y/n) " optional

if ! [[ "$optional" =~ ^([yY][eE][sS]|[yY]|[nN]|[nN][oO])$ ]]; then
echo "Please enter y or n"
echo ""
fi
done

echo ""

Expand Down
115 changes: 28 additions & 87 deletions priv/static/macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,29 @@ white='\033[0;37m'
green='\033[0;32m'
cyan='\033[0;36m'

# possible shells (cat /etc/shells)
almirsarajcic marked this conversation as resolved.
Show resolved Hide resolved
# /bin/bash
# /bin/csh
# /bin/dash
# /bin/ksh
# /bin/sh
# /bin/tcsh
# /bin/zsh

# current_shell=$(echo $SHELL | awk -F '/' '{print $NF}')

# if [[ $current_shell == "bash" ]]; then
# config_file="/Users/$USER/.bashrc"
# else
# current_shell="zsh"
# config_file="/Users/$USER/.zshrc"
# fi

function already_installed() {
case $1 in
"Xcode Command Line Tools")
"xcode")
which xcode-select >/dev/null
;;

"oh-my-zsh")
[ -d ~/.oh-my-zsh ]
;;
Expand All @@ -45,21 +62,9 @@ function already_installed() {
"Phoenix")
mix phx.new --version >/dev/null 2>&1
;;
"Node.js")
which node >/dev/null 2>&1
;;
"PostgreSQL")
which pg_ctl >/dev/null 2>&1
;;
"Chrome")
brew list | grep -q google-chrome
;;
"ChromeDriver")
brew list | grep -q chromedriver
;;
"Docker")
which docker >/dev/null 2>&1
;;
*)
echo "Invalid name argument on checking"
;;
Expand All @@ -68,7 +73,7 @@ function already_installed() {

function install() {
case $1 in
"Xcode Command Line Tools")
"xcode")
almirsarajcic marked this conversation as resolved.
Show resolved Hide resolved
xcode-select --install
;;
"oh-my-zsh")
Expand All @@ -89,29 +94,23 @@ function install() {

export KERL_CONFIGURE_OPTIONS="--without-javac --with-ssl=$(brew --prefix [email protected])"
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf install erlang 27.0
asdf global erlang 27.0
asdf reshim erlang 27.0
asdf install erlang 27.0.1
asdf global erlang 27.0.1
asdf reshim erlang 27.0.1
;;
"Elixir")
# Deps for elixir
brew install unzip

asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir 1.17.1-otp-27
asdf global elixir 1.17.1-otp-27
asdf reshim elixir 1.17.1-otp-27
asdf install elixir 1.17.2-otp-27
asdf global elixir 1.17.2-otp-27
asdf reshim elixir 1.17.2-otp-27
;;
"Phoenix")
source ~/.zshrc >/dev/null 2>&1
mix local.hex --force
mix archive.install --force hex phx_new 1.7.0-rc.3
;;
"Node.js")
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf install nodejs 20.14.0
asdf global nodejs 20.14.0
asdf reshim nodejs 20.14.0
mix archive.install --force hex phx_new 1.7.14
;;
"PostgreSQL")
# Dependencies for PSQL
Expand All @@ -125,21 +124,6 @@ function install() {
echo 'pg_ctl() { "$HOME/.asdf/shims/pg_ctl" "$@"; }' >>~/.profile
source ~/.zshrc >/dev/null 2>&1
;;
"Chrome")
brew install google-chrome
;;
"ChromeDriver")
# Dependencies for chromedriver
brew install zip

asdf plugin add chromedriver
asdf install chromedriver latest
asdf global chromedriver latest
asdf reshim chromedriver latest
;;
"Docker")
brew install --cask docker
;;
*)
echo "Invalid name argument on install"
;;
Expand Down Expand Up @@ -193,24 +177,6 @@ function add_env() {
sleep 1.5
maybe_install "PostgreSQL"

if [[ "$1" =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo -e "${white}"
sleep 3
maybe_install "Chrome"
echo -e "${white}"

sleep 1.5
maybe_install "Node.js"
echo -e "${white}"

sleep 2
maybe_install "ChromeDriver"
echo -e "${white}"

maybe_install "Docker"
echo -e "${white}"
fi

echo -e "${white}"
echo -e "${cyan}${bold}phx.tools setup is complete!"
echo -e "${cyan}${bold}Please restart the terminal and type in the following command:"
Expand Down Expand Up @@ -299,32 +265,7 @@ while ! is_yn "$answer"; do
echo ""
case "$answer" in
[yY] | [yY][eE][sS])
echo -e "${bblue}${bold}We can also install some optional tools:"

echo -e "${cyan}${bold}"

echo "1) Chrome"
echo "2) Node.js"
echo "3) ChromeDriver"
echo "4) Docker"

echo -e "${white}"
echo -e "${white} ${bold}"

optional=""

while ! is_yn "$optional"; do
read -p "Do you want us to install those as well? (y/n) " optional

if ! [[ "$optional" =~ ^([yY][eE][sS]|[yY]|[nN]|[nN][oO])$ ]]; then
echo "Please enter y or n"
echo ""
fi
done

echo ""

echo -e "${bblue}${bold}We're going to switch your default shell to Zsh even if it's not available yet, so you might see the following:"
echo -e "${bblue}${bold}We're going to switch your default shell to Zsh even if it's not available yet, so you might see the following:"
almirsarajcic marked this conversation as resolved.
Show resolved Hide resolved

echo -e "${bblue}${bold}chsh: Warning: /bin/zsh does not exist"

Expand Down
2 changes: 0 additions & 2 deletions test/scripts/script.exp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ spawn ./../../priv/static/$script
match_max 100000
expect "Do you want to continue? (y/n) "
send -- "y\r"
expect "Do you want us to install those as well? (y/n) "
send -- "y\r"
expect eof
Loading