-
-
Notifications
You must be signed in to change notification settings - Fork 97
New install/upgrade scripts for Cloud9. #145
Conversation
docs/cloud9.md
Outdated
@@ -0,0 +1,25 @@ | |||
## Description | |||
Cloud9 IDE is an online integrated development environment. It supports hundreds of programming languages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest we change the description since this isn't a "sales forum" 😁
Addition of how it's installed etc should probably be described since there's very little about it.
A link to the location for a local install would be recommended.
If that's not available let's limit this to:
Cloud9 IDE is an online integrated development environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to "Cloud9 SDK is an webservice IDE that makes it easy to manage you configuration files."
docs/cloud9.md
Outdated
Service status: `sudo systemctl status [email protected]` | ||
|
||
*** | ||
The installation script was originally contributed by [@Ludeeus](https://github.com/ludeeus). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limit these two to one line.
This script was originally contributed by @Ludeeus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in next commit.
node=$(which node) | ||
if [ -z "${node}" ]; then #Installing NodeJS if not already installed. | ||
printf "Downloading and installing NodeJS...\\n" | ||
curl -sL https://deb.nodesource.com/setup_8.x | bash - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8x is a rather old version and will cause problems with newer tools such as the miio tool used by the Xiaomi vacuum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8 is what we use for homebridge as well, so I need to test that before changing to 9 (the current version).
|
||
function cloud9-show-long-info { | ||
printf "Installs Cloud9 IDE onto this system.\\n" | ||
printf "Cloud9 IDE is an online integrated development environment. It supports hundreds of programming languages.\\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rephrase according to the description changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in next commit.
@@ -0,0 +1,9 @@ | |||
[Unit] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This service should be run after the network is available and most likely not after Home Assistant since a change to the config might cause Home Assistant not to start.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in next commit.
bash /home/homeassistant/c9sdk/scripts/uninstall-c9.sh | ||
rm -R /home/homeassistant/c9sdk | ||
rm -R /home/homeassistant/.c9 | ||
rm -R /home/homeassistant/.homeassistant/.c9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid making changes to the config directory since this might be something the user want's to keep a copy of. If not it's fairly easy to add it to for example .gitignore
printf "Stopping Cloud9 service...\\n" | ||
systemctl stop [email protected] | ||
sudo -u homeassistant -H /bin/bash << EOF | ||
printf "Downloading and installing newest version of Cloud9 SDK...\\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your mixing IDE and SDK throughout your descriptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script downloads the SDK which is what enable the IDE so I think it should say both, I have done some rephrasing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
echo "Changing to the homeassistant user" | ||
sudo -u homeassistant -H /bin/bash << EOF | ||
printf "Downloading and installing Cloud9 SDK...\\n" | ||
git clone git://github.com/c9/core.git /home/homeassistant/c9sdk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be preferable to have the installation in a proper location instead of in a users home directory?
Example could be AppDaemon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will look into moving it to something like /etc/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More like /opt
sync | ||
bash /home/homeassistant/c9sdk/scripts/uninstall-c9.sh | ||
rm -R /home/homeassistant/c9sdk | ||
rm -R /home/homeassistant/.c9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's only configuration files it's generally best practice no to touch these if they are in a users home directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved the default workspace to /home/homeassistant/ so we do no need to delete in ./homeassistant
This is still an WIP, there are a lot to be tested, but its an good start and it currently works. |
echo "Changing to the homeassistant user" | ||
sudo -u homeassistant -H /bin/bash << EOF | ||
printf "Downloading and installing Cloud9 SDK...\\n" | ||
git clone git://github.com/c9/core.git /home/homeassistant/c9sdk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More like /opt
printf "Stopping Cloud9 service...\\n" | ||
systemctl stop [email protected] | ||
sudo -u homeassistant -H /bin/bash << EOF | ||
printf "Downloading and installing newest version of Cloud9 SDK...\\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@Landrash I think I have corrected all your review comments and have now removed "WIP", could you do an other review? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Great job! 🍰
Description:
These scripts will install/upgrade Cloud9 IDE to manage home assistant configuration.
I have also included an remove function we can use in the future if we want to.
Checklist:
If pertinent:
/docs