Skip to content

Commit

Permalink
Fixed the urls in mconf-web-conf to point to the branch "latest", fix…
Browse files Browse the repository at this point in the history
…ed mconf-web-vm-conf and dumped to 0.4.1.
  • Loading branch information
daronco committed Oct 19, 2011
1 parent 30f7da0 commit ca6fa5b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 31 deletions.
4 changes: 2 additions & 2 deletions config/deploy/conf.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ staging:
user: "mconf" # User (in the server) used to deploy
repository: "git://github.com/mconf/mconf-web.git" # Repository to get the app from
scm: "git" # Repository scm
branch: "v0.4" # Branch or tag to be deployed
branch: "v0.4.1" # Branch or tag to be deployed
# scm_username: "scm-username" # Username to access the scm
# scm_password: "scm-pass" # Password to access the scm
# deploy_to: "/home/myuser/deploy_folder/" # Folder where the app will be in the server
Expand All @@ -35,4 +35,4 @@ production:
user: "mconf"
repository: "git://github.com/mconf/mconf-web.git"
scm: "git"
branch: "v0.4"
branch: "v0.4.1"
2 changes: 1 addition & 1 deletion lib/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Vcc
VERSION = "0.4".freeze
VERSION = "0.4.1".freeze

# get the current git branch
@@branch = nil
Expand Down
17 changes: 9 additions & 8 deletions script/mconf-web-conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
# This file was based on "bbb-conf" from BigBlueButton (http://www.bigbluebutton.org)
#
# See the change history for this file in our git at:
# https://github.com/mconf/mconf-web/blob/master/script/mconf-web-conf
# https://github.com/mconf/mconf-web/blob/latest/script/mconf-web-conf
#
# TODO:
# * --check
# * See other TODO: markers in the code
#
# Changelog:
# 2011-10-18 LCD Files downloaded from github come from the latest branch not master anymore
# 2011-10-07 LCD Version 0.3
# 2011-09-26 LCD God installation and configuration
# 2011-09-23 LCD The deployment now does not use capistrano and so it does not require a
Expand Down Expand Up @@ -258,12 +259,12 @@ nginx_install() {

# configures and creates the mconf-web virtual host
TEMP=`mktemp`
curl https://raw.github.com/mconf/mconf-web/master/config/apache2.conf.example -o $TEMP
curl https://raw.github.com/mconf/mconf-web/latest/config/apache2.conf.example -o $TEMP
sudo sed -i "s#ServerName .*#ServerName $IP#g" $TEMP
sudo sed -i "s#DocumentRoot .*#DocumentRoot $DEPLOY_PATH/public#g" $TEMP
sudo sed -i "s#<Directory .*>#<Directory $DEPLOY_PATH/public>#g" $TEMP
sudo mv $TEMP $APACHE_PATH/sites-available/mconf-web
sudo ln -f -s $APACHE_PATH/sites-available/mconf-web $APACHE_PATH/sites-enabled/mconf-web &>/dev/null
sudo a2ensite mconf-web

sudo /etc/init.d/apache2 restart
}
Expand Down Expand Up @@ -306,7 +307,7 @@ apache_install() {

# configures and creates the mconf-web virtual host
TEMP=`mktemp`
curl https://raw.github.com/mconf/mconf-web/master/config/apache2.conf.example -o $TEMP
curl https://raw.github.com/mconf/mconf-web/latest/config/apache2.conf.example -o $TEMP
sudo sed -i "s#ServerName .*#ServerName $IP#g" $TEMP
sudo sed -i "s#DocumentRoot .*#DocumentRoot $DEPLOY_PATH/public#g" $TEMP
sudo sed -i "s#<Directory .*>#<Directory $DEPLOY_PATH/public>#g" $TEMP
Expand Down Expand Up @@ -497,7 +498,7 @@ dependencies_include_package_list() {
# get the dependencies from github
install_dependency curl
TEMP=`mktemp`
sudo curl https://raw.github.com/mconf/mconf-web/master/config/packages.ubuntu -o $TEMP
sudo curl https://raw.github.com/mconf/mconf-web/latest/config/packages.ubuntu -o $TEMP
source $TEMP
}

Expand Down Expand Up @@ -732,15 +733,15 @@ deploy_configure_god() {
gem install god --no-ri --no-rdoc -v $GEM_VERSION_GOD

# global config file = loads all files in /etc/god/conf.d/
sudo curl https://raw.github.com/mconf/mconf-web/master/config/god/config -o /etc/god/config
sudo curl https://raw.github.com/mconf/mconf-web/latest/config/god/config -o /etc/god/config

# delayed_job config
sudo curl https://raw.github.com/mconf/mconf-web/master/config/god/delayed_job.god -o /etc/god/conf.d/delayed_job.god
sudo curl https://raw.github.com/mconf/mconf-web/latest/config/god/delayed_job.god -o /etc/god/conf.d/delayed_job.god
sudo sed -i "s:^RAILS_ROOT =.*:RAILS_ROOT = \"${DEPLOY_PATH}\":g" /etc/god/conf.d/delayed_job.god

# install and edit the init.d/god file
# reference: http://openmonkey.com/2008/05/27/god-init-script-for-debian-ubuntu-systems
sudo curl https://raw.github.com/mconf/mconf-web/master/config/god/init_script -o /etc/init.d/god
sudo curl https://raw.github.com/mconf/mconf-web/latest/config/god/init_script -o /etc/init.d/god
sudo sed -i "s:^GOD_LOG=.*:GOD_LOG=${DEPLOY_PATH}:g" /etc/init.d/god
sudo chmod a+x /etc/init.d/god
sudo update-rc.d god defaults
Expand Down
50 changes: 30 additions & 20 deletions script/mconf-web-vm-conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
# This file is part of Mconf - http://code.google.com/p/mconf
#
# See the change history for this file in our git at:
# https://github.com/mconf/mconf-web/blob/master/script/mconf-web-vm-conf
# https://github.com/mconf/mconf-web/blob/latest/script/mconf-web-vm-conf
#
# Changelog:
# 2011-09-23 LCD First version. Created from mconf-web-conf.
# 2011-10-18 LCD Adapted to Mconf VM 0.2
# 2011-10-06 LCD File created from mconf-web-conf contents
# 2011-07-05 LCD Inital Version


#
Expand All @@ -20,24 +22,24 @@ VM_ADDRESS=$(ifconfig | grep -v '127.0.0.1' | grep -E "[0-9]*\.[0-9]*\.[0-9]*\.[
# default port for BigBlueButton
VM_PORT=8888

SCRIPT_VERSION="0.3" # The version of this script
DEPLOY_PATH=~/mconf-web/current # local directory where the dev environment will be placed
SETUP_VM_IP=$IP # default IP/domain for BigBlueButton if not informed in --setup-vm
SETUP_VM_PORT=8888 # default port for BigBlueButton if not informed in --setup-vm
DEPLOY_BRANCH=stable # branch to be be deployed # TODO: change to v0.4
MCONF_VM_VERSION="0.2" # It should be used in this VM only
DEPLOY_PATH=~/mconf-web/current # local directory where the dev environment is
DEPLOY_REPO=git://github.com/mconf/mconf-web.git # used to checkout the production environment
DEPLOY_VERSION= # set this variable to define an specific version to be installed
# if not set, it will use the latest version available


#
# Usage and first check for parameters
#

usage() {
echo "Mconf-Web configuration script for the Mconf VM - Version $SCRIPT_VERSION"
echo "Mconf-Web configuration script for the Mconf VM - for the Mconf VM $MCONF_VM_VERSION"
echo "http://code.google.com/p/mconf"
echo
echo " mconf-web-vm-conf [-a ADDRESS] [-p PORT]"
echo " mconf-web-vm-conf [-a ADDRESS] [-p BIGBLUEBUTTON_PORT]"
echo " [ADDRESS] is the IP or name address of your machine."
echo " [PORT] is the port used for BigBlueButton."
echo " [BIGBLUEBUTTON_PORT] is the port used by BigBlueButton (set it with bbb-conf --setip)."
echo
echo " Other options:"
echo " --help, -h Shows this help"
Expand All @@ -55,11 +57,6 @@ check_root() {
fi
}

#if [ $# -eq 0 ]; then
# usage
# exit 1
#fi


#
# Parse the parameters
Expand Down Expand Up @@ -199,7 +196,7 @@ config_files_setup_vm() {
sed -i "s/\(^[[:space:]]*bbb_server_url:\)[^#$]*\(.*\)$/\1 \"http:\/\/${VM_ADDRESS}:${VM_PORT}\/bigbluebutton\/api\" \2/g" $MCONF_WEB_SETUP_CONF
sed -i "s/\(^[[:space:]]*bbb_server_salt:\)[^#$]*\(.*\)$/\1 \"${SALT}\" \2/g" $MCONF_WEB_SETUP_CONF
sed -i "s/\(^[[:space:]]*site_domain:\)[^#$]*\(.*\)$/\1 \"${VM_ADDRESS}\" \2/g" $MCONF_WEB_SETUP_CONF
sudo sed -i "s/server_name .*/server_name ${VM_ADDRESS};/" /etc/nginx/sites-available/mconf-web
sudo sed -i "s/ServerName .*/ServerName ${VM_ADDRESS};/" /etc/apache2/sites-enabled/mconf-web

echo
echo "################################################################################"
Expand All @@ -223,6 +220,18 @@ config_files_setup_vm() {
echo
}

# Returns in $REPLY the latest tag created = the latest version
get_version_to_be_installed() {
if [ $DEPLOY_VERSION ]; then
REPLY=$DEPLOY_VERSION
else
# ls-remote anwsers with lines such as:
# 901dfadd9951371e40f7696a7ddc7fd1395e8741 refs/tags/v0.3^{}
REPLY=`git ls-remote --tags ${DEPLOY_REPO} v\*^{} | tail -1 | sed 's:.*refs/tags/\(.*\)^{}:\1:'`
fi
}


check_root

echo
Expand All @@ -242,9 +251,10 @@ config_files_setup_vm

cd $DEPLOY_PATH

echo "-- Updating the development environment at master branch"
git checkout $DEPLOY_BRANCH
git pull origin $DEPLOY_BRANCH
get_version_to_be_installed
echo "-- Checking out version: ${REPLY}"
git checkout $REPLY
git pull origin $REPLY &>/dev/null # just in case a branch needs to be updated

echo "-- Configuring the application"
bundle exec rake setup:db RAILS_ENV=production
Expand All @@ -254,7 +264,7 @@ echo "-- Restarting Apache"
sudo /etc/init.d/apache2 restart

echo
echo "-- Configuration files edition finished."
echo "-- Mconf-Web configuration finished."
echo


0 comments on commit ca6fa5b

Please sign in to comment.