Skip to content

Instantly share code, notes, and snippets.

@pvmchau
Last active December 10, 2015 02:38
Show Gist options
  • Save pvmchau/4368961 to your computer and use it in GitHub Desktop.
Save pvmchau/4368961 to your computer and use it in GitHub Desktop.
Deloy blog dashboard, blogger blocks and Newsfeed page.
<?php
$root = '/home/andytruong/live';
$tmp = '/home/andytruong/tmp';
$drush = '/home/andytruong/drush/drush';
function run($cmds = array()) {
if (is_string($cmds)) return run(array($cmds));
foreach ($cmds as $cmd) {
print_r($cmd . "\n");
passthru($cmd);
}
}
# Go to current site directory
run("cd $root");
# Backup the current site
run("$drush ard");
# Blog dashboard
## Remove old code of custom_blog module.
run("mkdir -p $tmp");
run("mv $root/sites/all/modules/custom_blog $tmp/");
## Clone new code of custom_blog module from git@bitbucket.org:pvmchau/custom_blog.git
run("git clone git@bitbucket.org:pvmchau/custom_blog.git");
run("mv custom_blog $root/sites/all/modules/custom_blog");
# Blogger blocks
## Clone module blogger_member-6.x-1.0 from git@bitbucket.org:pvmchau/blogger-blocks.git
run("git clone git@bitbucket.org:pvmchau/blogger-blocks.git");
run("mv blogger-blocks $root/sites/all/modules/");
## Enable module blogger_member-6.x-1.0
run("$drush dl features_extra");
run("$drush en -y blogger_members");
# Newsfeed page
## Clone module vc_newsfeed and comments_ajax from git@bitbucket.org:pvmchau/vc-newsfeed-page.git
run("git clone git@bitbucket.org:pvmchau/vc-newsfeed-page.git");
run("mv vc-newsfeed-page $root/sites/all/modules/");
## Enable module vc_newsfeed and comments_ajax
run("$drush en -y vc_newsfeed");
run("$drush en -y comments_ajax");
# Update AMR stylesheet files
## Clone new css files
run("git clone git@bitbucket.org:pvmchau/amr-upgrade-stylesheet-files.git");
run("mv $root/sites/all/themes/academicroom/custom-classes.css $tmp/");
run("mv $root/sites/all/themes/academicroom/videos.css $tmp/");
run("mv amr-upgrade-stylesheet-files/*.css $root/sites/all/themes/academicroom/");
run("mv amr-upgrade-stylesheet-files $root/sites/all/modules/");
run("$drush en -y newsfeed_settings");
## Clear all cache
run("$drush cc all");
?>
# Deloy AMR update.
## Important: BACKUP your files and database before doing below update steps.
## Blog dashboard
1. Remove old code of custom_blog module.
1. Clone new code of custom_blog module from git@bitbucket.org:pvmchau/custom_blog.git
## Blogger blocks
1. Clone module blogger_member-6.x-1.0 from git@bitbucket.org:pvmchau/blogger-blocks.git
1. Enable module blogger_member-6.x-1.0.
## Newsfeed page
1. Clone module newsfeed_page-6.x-1.0 from git@bitbucket.org:pvmchau/vc-newsfeed-page.git
1. Enable module vc_newsfeed and comments_ajax.
## Upgrade css and js
1. Clone css and js files from git@bitbucket.org:pvmchau/amr-upgrade-stylesheet-files.git
1. Move these file to right directory:
- Css: sites\all\themes\academicroom
- Module newsfeed_style: sites\all\modules\amr-upgrade-stylesheet-files\newsfeed_style
1. Clear all cache.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment