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

Added support for Jekyll and Angular #3

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ignore the .vagrant folder
.vagrant

#Ignore all cloned repos/folders
*/

#Dont ignore the html folder/readme or vagrant config files
!/html
!/vagrantConfig
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# coffeemaker
# CoffeeMaker

![CofeeMaker Vagrant .gif](https://cloud.githubusercontent.com/assets/1448289/15005253/e4156dce-1176-11e6-84a6-8aff8439ee97.gif)

Vagrant Box with all tools needed to work on C&&C projects

This includes tools such as NodeJS, NPM, Ruby, and Jekyll
13 changes: 13 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Vagrant.configure(2) do |config|

#Define the ubuntu box
config.vm.box = "ubuntu/trusty64"

# Name the Vagrant instance
config.vm.define "CodeAndCoffeeVagrant"

# Forward our ports
# 80 for apache, 4000 for jekyll
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 4000, host: 4000

# Run bootstrap script
config.vm.provision :shell, path: "bootstrap.sh", privileged: false
end
110 changes: 110 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#!/usr/bin/env bash

#Welcome the user
echo "Welcome to the Code And Coffee Long Beach vagrant!"
echo "We are now provisioning the vagrant box..."

#Remove Non-interactive .bashrc lines
echo "Modifying .bashrc to allow edits"
sed '5,10d;' /home/vagrant/.bashrc > /home/vagrant/.bashrcNew
mv /home/vagrant/.bashrcNew /home/vagrant/.bashrc

#Update The Distro
sudo apt-get update

#Download things for Npm and Ruby(Compass and things)
sudo apt-get install -y git build-essential libssl-dev git-core curl zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev vim apache2

#Install apache2

# Replace apache dir.conf, enable apache php
sudo cp /vagrant/vagrantConfig/dir.conf /etc/apache2/mods-enabled/dir.conf

#Restart apache
sudo service apache2 restart

#Set our document root so we can access it
sudo cp /vagrant/vagrantConfig/000-default.conf /etc/apache2/sites-available/000-default.conf

#Restart apache
sudo service apache2 restart

#Allow .htaccess overrides
sudo cp /vagrant/vagrantConfig/apache2.conf /etc/apache2/apache2.conf
sudo a2enmod rewrite
sudo apache2ctl configtest

#Own the html directory by www-data
sudo chown -R vagrant:www-data /vagrant/html
sudo chmod -R 755 /vagrant/html

#Restart apache for the permissions change
sudo service apache2 restart

#Install NVM (Node Version Manager)
curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | sh
source /home/vagrant/.bashrc

#Install Node (Latest LTS on 4/23/16)
nvm install 4.4.3
nvm use 4.4.3
node -v
nvm alias default 4.4.3

#Install npm without sudo
curl https://raw.githubusercontent.com/glenpike/npm-g_nosudo/master/npm-g-nosudo.sh | sh < /vagrant/npmNoSudoInput.txt
source /home/vagrant/.bashrc

#Install RbEnv
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
source /home/vagrant/.bashrc

#Use RBEnv To install Ruby (Latest on 4/23/16)
rbenv install -v 2.3.0
rbenv global 2.3.0

#ensure it installed
ruby -v

#ruby gem tweaking
echo "gem: --no-document" > ~/.gemrc
gem install bundler

#Install Rails
gem install rails
rbenv rehash
rails -v

#INstall compass
gem install compass
rbenv rehash

#Install Jekyll
gem install jekyll
rbenv rehash

#Install Bundler
gem install bundle
rbenv rehash

#Update npm, Install grunt and bower with npm
npm install -g npm
npm install --global bower grunt-cli
bower --version
grunt --version

#Add our awesome ubuntu banner
sudo cp /vagrant/vagrantConfig/sshd_config /etc/ssh/sshd_config
sudo cp /vagrant/vagrantConfig/issue.net /etc/issue.net
sudo cp /vagrant/vagrantConfig/issue.net /etc/motd

#Finished!

#Salutations to the user
echo "Thank you for using the Code And Coffee Long Beach Vagrant!"
echo "Have a nice day!"
3 changes: 3 additions & 0 deletions html/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This folder is used by apache

Place your projects/files you would like apache to serve here
31 changes: 31 additions & 0 deletions vagrantConfig/000-default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /vagrant/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
5 changes: 5 additions & 0 deletions vagrantConfig/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This folder is used by Vagrant for provisioning

Here you will find files that are preconfigured to work with the code and coffee vagrant,

Such as apache files, as well as some files to enable the ssh banner
Loading