This repository has been archived by the owner on Oct 1, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
77 additions
and
7 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: apostello | ||
image: ubuntu-14-04-x64 | ||
min_size: 512mb | ||
config: | ||
#cloud-config | ||
users: | ||
- name: apostello | ||
groups: sudo | ||
shell: /bin/bash | ||
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | ||
packages: | ||
- curl | ||
runcmd: | ||
- cd /home/apostello && curl -sf https://raw.githubusercontent.com/monty5811/apostello/master/scripts/install.sh | sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
set -e | ||
AP_VER=v1.6.0 | ||
|
||
echo "Installing and upgrading packages" | ||
sudo apt-get update -qq | ||
sudo apt-get upgrade -y | ||
sudo apt-get install -y \ | ||
git \ | ||
libffi-dev libssl-dev openssl \ | ||
python-virtualenv python-dev | ||
|
||
echo "Setting up ansible environment" | ||
if [ ! -d 'apostello-install' ]; then | ||
echo "First run, cloning apostello..." | ||
git clone https://github.com/monty5811/apostello.git apostello-install | ||
cd apostello-install | ||
git checkout $VERSION | ||
echo "Setting up virtualenv" | ||
virtualenv venv --no-site-packages | ||
./venv/bin/pip install -U pip | ||
./venv/bin/pip install -U setuptools | ||
./venv/bin/pip install ansible | ||
else | ||
cd apostello-install | ||
echo "Updating apostello..." | ||
git fetch | ||
git checkout $AP_VER | ||
fi | ||
|
||
cd ansible | ||
echo "Detecting IP and writing to config" | ||
IP=`ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'` | ||
sed -i -e "s/server_name_replace_me/$IP/g" env_vars/example.yml | ||
|
||
echo "Running ansible deploy" | ||
./../venv/bin/ansible-playbook -i 127.0.0.1, production.yml --connection=local | ||
|
||
echo "################################################################" | ||
echo "## apostello is now running on this server ##" | ||
echo "## ##" | ||
echo "## If this is your first time setup, you need edit ##" | ||
echo "## apostello-install/ansible/env_vars/example.yml ##" | ||
echo "## ##" | ||
echo "## You must set up your email settings, or apostello will not ##" | ||
echo "## function correctly! ##" | ||
echo "## ##" | ||
echo "## Email setup: http://goo.gl/nkjPdy ##" | ||
echo "## Twilio setup: http://goo.gl/2lt8dX ##" | ||
echo "## ##" | ||
echo "## Then run the command: ##" | ||
echo "## ./apostello-install/scripts/install.sh ##" | ||
echo "## ##" | ||
echo "## Future upgrades can be carried out by running the same ##" | ||
echo "## command ##" | ||
echo "## ##" | ||
echo "################################################################" |