Created
November 16, 2017 13:22
-
-
Save acburdine/3e0ad63dfb708cc744133d2daa658122 to your computer and use it in GitHub Desktop.
ghost-cli-droplet-init
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Upgrade things initially | |
apt update && apt upgrade -y | |
# Add Yarn repo | |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | |
# Install NodeJS 8 package repo (runs apt update in the script which is why we add yarn first) | |
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - | |
# Add some stuff so mysql doesn't prompt (see https://stackoverflow.com/questions/7739645/install-mysql-on-ubuntu-without-password-prompt) | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password password' | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password password' | |
# Install ALL THE THINGS | |
apt install -y nginx mysql-client mysql-server yarn nodejs | |
# Add the user account (see https://askubuntu.com/questions/319714/proper-way-to-add-a-user-account-via-bash-script) | |
useradd mynewuser -s /bin/bash -m -g acburdine -G sudo | |
sudo chpasswd << 'END' | |
acburdine:password | |
END | |
# Clone repo | |
cd /home/acburdine | |
sudo -u acburdine git clone https://github.com/acburdine/Ghost-CLI-1 cli | |
cd /home/acburdine/cli | |
sudo -u acburdine yarn install | |
# Create ghost install dir | |
mkdir -p /var/www/ghost | |
chown -R acburdine:acburdine /var/www/ghost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment