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

Automatic install scripts for #11 #23

Merged
merged 24 commits into from
Oct 2, 2020
Merged

Automatic install scripts for #11 #23

merged 24 commits into from
Oct 2, 2020

Conversation

th0mas
Copy link
Contributor

@th0mas th0mas commented Aug 26, 2020

Install scripts to allow for a "One Click" setup of smart home.

Can be used by running:

bash <(curl -sL https://git.io/JUIen) # POSIX-compatible shell (e.g. bash/zsh/most shells)
bash (curl -sL https://git.io/JUIen | psub) # Fish shell

This will download and install the smart-home-security-system repositories and do any required configuration changes.
Will fix #11

@@ -0,0 +1,98 @@
# Management script for dwyl smart home
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@th0mas totally get that this is "WIP", but it's looking good so far and thanks for your conscientiousness! 🙌

@th0mas
Copy link
Contributor Author

th0mas commented Aug 27, 2020

@nelsonic can you test this out on your system?

Should be able to run bash <(curl -sL https://git.io/JUIen) to install

manage.py Show resolved Hide resolved
@th0mas th0mas requested a review from nelsonic August 28, 2020 14:43
@nelsonic
Copy link
Member

Just confirmed that the default version of Python on MacOS Catalina (Latest) is not 3.x:

python --version
Python 2.7.16

Could be worth adding a link to where people can download/install the latest Python. 💭

@nelsonic
Copy link
Member

https://docs.python-guide.org/starting/install3/osx/
Install homebrew:

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

then install python:

brew install python

@nelsonic
Copy link
Member

https://xkcd.com/1987
image

@nelsonic
Copy link
Member

After installing with python with homebrew still got:

python --version
Python 2.7.16

Had to follow: https://dev.to/malwarebo/how-to-set-python3-as-a-default-python-version-on-mac-4jjf
Ran the command:

ln -s -f /usr/local/bin/python3.8 /usr/local/bin/python

Now have:

python --version
Python 3.8.5

Running the script now.

@th0mas
Copy link
Contributor Author

th0mas commented Aug 28, 2020

Pretty sure python should always reference python 2.x, and python3 references Python 3.x for backwards compatibility reasons

@th0mas
Copy link
Contributor Author

th0mas commented Aug 28, 2020

@nelsonic you shouldn't have to worry about this if you run bash <(curl -sL https://git.io/JUIen), that's the point of the initial bash script

@th0mas
Copy link
Contributor Author

th0mas commented Aug 28, 2020

Yeah think were working on the assumption that users have Postgres and Elixir installed?

If not that's ~5 lines to prompt user and install

@th0mas
Copy link
Contributor Author

th0mas commented Aug 28, 2020

Side note: wget not found - guessing that's not default with macOS then.

@nelsonic
Copy link
Member

Yeah, wget not standard on Mac. 🙄

Got Elixir and Postgres:
elixir-version

postgres-running

@nelsonic
Copy link
Member

git-pull

going to try run the script again. 👍

@th0mas
Copy link
Contributor Author

th0mas commented Aug 28, 2020

wget swapped for curl in d665246

@nelsonic
Copy link
Member

Script hangs on Installing hub server deps...
script-hangs

Going to kill it so I can run the latest version:
git-pull-d665246

klll-python-script

@th0mas
Copy link
Contributor Author

th0mas commented Aug 28, 2020

Script hangs on Installing hub server deps...

Thats odd, how long did you leave it for? And try running ./manage.py --verbose install to see mix output

@nelsonic
Copy link
Member

Will run with verbose after standup. ⏳

@nelsonic
Copy link
Member

db-fail

@nelsonic
Copy link
Member

brew install postgres giving me grief so using https://postgresapp.com/ instead

@nelsonic
Copy link
Member

Screen Shot 2020-08-28 at 5 26 31 PM

@nelsonic
Copy link
Member

After exporting the AUTH_API_KEY in the cwd it works:
hub-working

@@ -114,6 +114,80 @@ def gen_token():
print(proc.stdout.decode(sys.stdout.encoding))
print("\nSet this as the authorization header in your favourite API development tool.")

# Install brew, otherwise exit
def must_install_brew():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is so much more maintainable than a bash script. 👍

@th0mas
Copy link
Contributor Author

th0mas commented Sep 1, 2020

@nelsonic Want to try this again?

@nelsonic
Copy link
Member

nelsonic commented Sep 4, 2020

@th0mas when you are next available, we will do a Zoom remote-pairing session to re-test this. 📆
I think it's worth finishing this PR even if you decide to go for the Docker approach. 💭

@th0mas th0mas requested a review from nelsonic September 9, 2020 13:45
Copy link
Member

@nelsonic nelsonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@th0mas the updates you made last week all look good. 👍

@th0mas th0mas marked this pull request as ready for review October 2, 2020 08:06
@th0mas th0mas merged commit 7e94861 into master Oct 2, 2020
@th0mas th0mas mentioned this pull request Oct 2, 2020
2 tasks
@nelsonic nelsonic deleted the install branch October 2, 2020 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make development setup easier
2 participants