[theslinux-phantom] theslinux-home branch master updated 27fcff7 etc.web: delete :core config. from the :master

  • From: git@xxxxxxxxxxxxxxxxxxxx
  • To: theslinux-phantom@xxxxxxxxxxxxx
  • Date: Sun, 28 Jul 2013 08:54:38 -0700

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "theslinux-home".

The branch, master has been updated
       via  27fcff7818e1f79168dedd9f70ea5bc7c21d0914 (commit)
       via  3c3000b69b5f632230951126991f59e7ae24c4f9 (commit)
       via  64d696ee1b25383f4a10628ae1296c7fbe444650 (commit)
       via  5024b24348f90220747e3e04c0d1fdf495a38d9c (commit)
      from  b0455b88c50f040fe6b5852c65c0d6fd07c0d0c0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 27fcff7818e1f79168dedd9f70ea5bc7c21d0914
Author: Ky-Anh Huynh <kyanh@xxxxxxxxxxxxx>
Date:   Sun Jul 28 22:31:00 2013 +0700

    etc.web: delete :core config. from the :master
    
    The web configuration is now on :core branch

commit 3c3000b69b5f632230951126991f59e7ae24c4f9
Author: Ky-Anh Huynh <kyanh@xxxxxxxxxxxxx>
Date:   Sun Jul 28 22:29:12 2013 +0700

    README: + new notes about the diff. between 2 branches
    
    The two branches :core and :master are now very different. I do not
    now why this happens. But this is very true. We now do not want to
    develop :core features on :master, nor to develop :users stuff on
    the :core -- that should be used for Ruby scripts

commit 64d696ee1b25383f4a10628ae1296c7fbe444650
Author: Ky-Anh Huynh <kyanh@xxxxxxxxxxxxx>
Date:   Sun Jul 28 22:23:55 2013 +0700

    bin: remove the :core scripts

commit 5024b24348f90220747e3e04c0d1fdf495a38d9c
Author: Ky-Anh Huynh <kyanh@xxxxxxxxxxxxx>
Date:   Sun Jul 28 22:13:40 2013 +0700

    bin.example-nanoc: rewrite to support Rubies, rolo
    
    The script now supports system Ruby or Rvm (1.9 or 2.0). The rolo
    gem is also used to prevent nanoc/guard from running twice
    
    We also remove :nohup support, because user can help...

-----------------------------------------------------------------------

Summary of changes:
 README.md                              |   8 ++
 bin/berlios.update.sh                  |  53 ---------
 bin/example-start-local-nanoc-stuff.sh |  84 +++++++++----
 bin/git.hook.post-receive.sh           | 210 ---------------------------------
 etc/apache.rewrite.conf                |  28 -----
 etc/nginx.rewrite.conf                 |  31 -----
 6 files changed, 69 insertions(+), 345 deletions(-)
 delete mode 100755 bin/berlios.update.sh
 delete mode 100755 bin/git.hook.post-receive.sh
 delete mode 100644 etc/apache.rewrite.conf
 delete mode 100644 etc/nginx.rewrite.conf

diff --git a/README.md b/README.md
index 83a12f6..3b944c7 100644
--- a/README.md
+++ b/README.md
@@ -38,6 +38,11 @@ should not be updated by non-privileged developers. Because 
there are
 some mergences that causes very bad and messy logs, please consider to
 use `cherry-pick` if you want to use any `core` feature on your branch.
 
+*Important notes*: Since 2013 July 28th, the two branches are divergent
+and you can't merge them. The only way to get `core` feature is to use
+`cherry-pick`. However, you should not do that unless you really mean
+what you are going to do.
+
 ## Requirements
 
 The following `Ruby` gems are required to build source files with `nanoc`
@@ -55,3 +60,6 @@ any change `guard` will invoke `nanoc compile` to build your 
source.
 Please take a look at the example in
 
     ./bin/example-start-local-nanoc-stuff.sh
+
+This command normally generates so many output from `Guard` and `nanoc`.
+You may skip all or most of them by using some known redirections.
diff --git a/bin/berlios.update.sh b/bin/berlios.update.sh
deleted file mode 100755
index 0ea2138..0000000
--- a/bin/berlios.update.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# Purpose: Update the page theslinux.berlios.d
-# Author : Anh K. Huynh
-# Date   : 2013 May 25th
-# License: GPL v2
-
-_D_TMP="$HOME/tmp/"
-_D_DEST="/home/groups/theslinux/htdocs/"
-_F_SRC="theslinux.org.tgz"
-
-msg() {
-  echo "(berlios) $*"
-}
-
-err() {
-  echo >&2 "(berlios) $*"
-}
-
-die() {
-  err "$*"
-  exit 1
-}
-
-_main() {
-  cd $_D_TMP || die "Can't switch to $_TMP_DIR"
-
-  msg "Downloading $_F_SRC from theslinux.org"
-  rm -rf $_D_TMP/$_F_SRC $_D_TMP/theslinux.org/ \
-  || die "Can't clean up the old file $_F_SRC"
-
-  wget \
-      http://m0.theslinux.org/$_F_SRC?$(date +%s) \
-      -O $_F_SRC -o /dev/null \
-  || die "Can't download source file from theslinux.org"
-
-  msg "Extracting $_F_SRC"
-  tar -xzf $_F_SRC
-
-  msg "Synchronizing files"
-  rsync \
-      -ra --delete \
-      "$_D_TMP/theslinux.org/" \
-      --exclude="usage*" \
-      $_D_DEST/ \
-    2>&1 1>/dev/null \
-  | grep -v 'failed to set times on' \
-  | grep -v '/attrs were not transferred'
-
-  msg "Please report to the team if you see any error before this line"
-}
-
-_main
diff --git a/bin/example-start-local-nanoc-stuff.sh 
b/bin/example-start-local-nanoc-stuff.sh
index 1761929..567d54d 100755
--- a/bin/example-start-local-nanoc-stuff.sh
+++ b/bin/example-start-local-nanoc-stuff.sh
@@ -1,30 +1,68 @@
 #!/usr/bin/bash
-
+#
+# Author : Anh K. Huynh
+# License: Fair license
+# Date   : 2013 July {3rd, 28th}
 # Purpose: Start Guard, nanoc view for local development
 #
-#   * Start `guard` to watch the source tree. If there is any
-#     update on any files, `guard` will execute `nanoc watch`
-#     to compile the source. All standard errors will be ignored,
-#     so you may need to tune this script.
+# * Start `guard` to watch the source tree. If there is any
+#   update on any files, `guard` will execute `nanoc watch`
+#   to compile the source. All standard errors will be ignored,
+#   so you may need to tune this script.
 #
-#   * Start `nanoc view` to create local server http://localhost:3000/.
-#     Because `nanoc view` doesn't support indexing, you need to use
-#     an absolute URI if there isn't index file in the source. E.g,
-#     if you only have
-#         contents/my/article.html
-#     you need to access to
-#         http://localhost:3000/my/article/
-#     becuase accessing to http://localhost:3000/my/ will report error.
+# * Start `nanoc view` to create local server http://localhost:3000/.
+#   Because `nanoc view` doesn't support indexing, you need to use
+#   an absolute URI if there isn't index file in the source. For example,
+#   to view the compiled HTML version of the document
+#       contents/my/article.html
+#   you need to type on your browser's addressbar
+#       http://localhost:3000/my/article/
+#   (In production environment, accessing to http://theslinux/my/ lists
+#   the page `/article/` in the `index` page.)
 #
-# Author : Anh K. Huynh
-# License: Fair license
-# Date   : 2013 July 3rd
-# Note   : This is only an example script. Use at your own risk
+# Notes:
+#
+# * This script is only an example script. Use at your own risk
+# * If you run this script multiple time you may launch many instances
+#   of `guard` program. To avoid that, you may install `rolo` gem
+#   which is detected automatically and used in this script
+#
+
+[[ -f "Guardfile" ]] \
+|| {
+  echo >&2 ":: Error: No Guardfile found"
+  echo >&2 ":: You should start from a directory that has a 'Guardfile'"
+  exit 1
+}
+
+[[ ! -f /etc/profile.d/rvm.sh ]] \
+|| source /etc/profile.d/rvm.sh
+
+{ ruby -v | grep -qE '(2\.0)|(1\.9)' ; } \
+|| rvm use ruby-2.0 \
+|| rvm use ruby-1.9 \
+|| {
+  echo >&2 ":: Unable to find Ruby (1.9|2.0) environment"
+  exit 1
+}
 
-[[ ! -f /etc/profile.d/rvm.sh ]] || source /etc/profile.d/rvm.sh
-[[ -f "Guardfile" ]] || { echo >&2 ":: Error: No Guardfile found"; exit 1; }
-rvm use ruby-2.0
-{ ruby -v | grep -q 2.0 ; } || { echo >&2 ":: Error: Not Ruby-2 found"; exit 
1; }
+which rolo >/dev/null 2>&1 \
+|| {
+  echo 2>&1 ":: Warning: Optional gem 'rolo' (>= 1.1.1) not found"
+  echo 2>&1 ":: Install 'rolo' gem to prevent 'guard' from running twice"
+}
 
-nohup guard start --no-interactions >/dev/null 2>&1 &
-nohup nanoc view >/dev/null 2>&1 &
+which guard >/dev/null \
+&& which nanoc >/dev/null \
+&& {
+  rolo=" "
+  which rolo >/dev/null 2>&1 && rolo="rolo --no-bind -a 127.0.0.1 -p 3000"
+  echo ":: Starting Guard (on background) to watch files"
+  $rolo guard start --no-interactions &
+  echo ":: Starting Nanoc (on background) to view files at 
http://localhost:3000/";
+  $rolo nanoc view &
+} \
+|| {
+  echo >&2 ":: Error: 'guard'/'nanoc' not found. Please install these gems"
+  exit 127
+}
diff --git a/bin/git.hook.post-receive.sh b/bin/git.hook.post-receive.sh
deleted file mode 100755
index 64c8969..0000000
--- a/bin/git.hook.post-receive.sh
+++ /dev/null
@@ -1,210 +0,0 @@
-#!/bin/bash
-
-# Purpose: provides a `post-receive` hook to compile `nanoc source
-#          to a static site.
-# Date   : 2013  Mar 04th
-# Author : Anh K. Huynh
-# License: GPL v3
-
-unset GIT_DIR
-export HOME=/home/git
-export LANG=en_US.UTF-8
-
-_D_VAR="$HOME/var/theslinux-home/"
-_F_LOCK="$HOME/var/theslinux-home.lock"
-_D_WWW="$HOME/static/www/theslinux.org/"
-_D_OUTPUT="$_D_VAR/output/"
-_F_ARCHIVE="$_D_WWW/theslinux.org.tgz"
-_S_BERLIOS="kyanh@xxxxxxxxxxxxxxxx"
-
-msg() {
-  echo ":: $*"
-}
-
-err() {
-  echo >&2 ":: $*"
-}
-
-die() {
-  err "$*"
-  _lock_end
-  exit 1
-}
-
-_setup() {
-  if [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
-    source "$HOME/.rvm/scripts/rvm"
-    rvm use ruby1.9
-  else
-    die "rvm not found. We need ruby1.9"
-  fi
-
-  # source $HOME/bin/ssh-agent.sh >/dev/null 2>&1 \
-  #   || die "Can't load ssh configuration"
-  #
-  # msg "Testing ssh connection (skipped)"
-  # [[ $? -eq 0 ]] || die "Can't make connect to remote server 
ssh.tuxfamily.org"
-
-  cd $_D_VAR || die "Can't switch to directory $_D_VAR"
-}
-
-_update() {
-  msg "Updating the local source tree"
-  git reset --hard
-  git fetch --all
-  git checkout master || die "Can't switch to the branch :master"
-  git pull --rebase || die "Can't update local source tree. Please ask your 
sysadmin for details"
-
-  msg "Removing erb files"
-  rm -r lib/* layouts/* _i/*
-  find .          -type f -iname "*.rb" -exec rm -f {} +
-  find ./content/ -type f -iname "*.sh" -exec rm -f {} +
-
-  msg "Removing some files that should not be cached"
-  rm  -f output/changes/index.html
-  rm -rf output/tags/* output/rss/*
-
-  msg "Fetching Ruby files from the branch :core"
-  git archive \
-      --format=tar core \
-      --remote=~/repositories/theslinux-home.git \
-    | tar --wildcards -xf - \
-        'Rules' \
-        '*.rb' \
-        'layouts/*' \
-        'config.yaml' \
-        'content/stylesheet.css' \
-        'etc/apache.rewrite.conf'
-
-  [[ "$(date +%Y)" == "2013" ]] || rm -f "contents/news/index.html"
-}
-
-_fetch_apache_configuration() {
-  msg "Updating Apache configuration. Nginx requires manual edit"
-  mv "etc/apache.rewrite.conf" "$_D_OUTPUT/.htaccess"
-}
-
-_update_myself() {
-  msg "Do nothing"
-}
-
-_build() {
-  cd $_D_VAR/ || die "Couldn't switch to directory $_D_VAR/"
-
-  msg "Cleaning up the old files"
-  nanoc prune --yes
-  msg "Rebuilding the static pages"
-  nanoc \
-    || {
-         msg "Something wrong happened when building the pages."
-         die "Please contact the system administrator for support."
-       }
-}
-
-_fix_perm() {
-  msg "Updating files permission"
-  find $_D_OUTPUT/ -mindepth 1 -type d -exec chmod 755 {} +
-  find $_D_OUTPUT/ -mindepth 1 -type f -exec chmod 644 {} +
-}
-
-# NOTE: all files `*.tgz` are ignored
-_create_www() {
-  msg "Transferring files to directory 'www' on l00s3r (m0)"
-  rsync -rap --delete $_D_OUTPUT/ $_D_WWW/ --exclude="*.tgz"
-}
-
-# NOTE: Should be invoked after (create_www)
-_create_archive() {
-  cd $_D_VAR/ || die "Couldn't switch to $_D_VAR/"
-
-  msg "Creating local archive for Tuxfamily"
-  tar --transform="s,^output,theslinux.org," -czf $_F_ARCHIVE output/
-  chmod 644 $_F_ARCHIVE
-}
-
-# See also https://github.com/TheSLinux/homepage/commit/ \
-#   27372a4e26d67bd63c0d4e25fd2ebc1ddb791112
-_fix_news_page() {
-  msg "'news' page: Add a trick to have per-year support"
-  msg "See also https://github.com/TheSLinux/homepage/commit/";
-  msg "   .... 27372a4e26d67bd63c0d4e25fd2ebc1ddb791112"
-
-  # In the year 2013 we are still using the `news/index.hml` for items
-  if [[ "$(date +%Y)" == "2013" ]]; then
-    mkdir -p "$_D_OUTPUT/news/2013/"
-    pushd "$_D_OUTPUT/news/2013/"
-    ln -s "../index.html" "index.html"
-    popd
-  else # we now use contents/news/<year>.html to save items
-    pushd "$_D_OUTPUT/news/"
-    ln -s "$(date +%Y)/index.html" "index.html"
-    popd
-  fi
-}
-
-_sync() {
-  msg "Updating home page theslinux.berlios.de"
-  ssh -o ConnectTimeout=3 $_S_BERLIOS
-  if [[ $? -ge 1 ]]; then
-    msg "=============================================="
-    msg "Error happened when updating pages on Berlios."
-    msg "This is often due to bad ssh settings on Berlios.de"
-    msg "This is *not* an error at your side. Please contact"
-    msg "sysadmin to resolve this problem -- theslinux.org."
-    msg "=============================================="
-    return 1
-  else
-    msg "All pages have been updated."
-    msg "Thank you for your contribution. You make TheSLinux live!"
-  fi
-}
-
-# NOTE: Never use (die) in this method
-_lock_start() {
-  if [[ ! -f "$_F_LOCK" ]]; then
-    touch "$_F_LOCK" || die "Can't create lock file"
-    return 0
-  fi
-
-  t_lok="$(date -r $_F_LOCK +%s)"
-  t_now="$(date +%s)"
-
-  distance=$((t_now - t_lok))
-  if [[ $distance -ge 300 ]]; then
-    msg "Lock file is too old. Is this file obsolete?"
-    touch "$_F_LOCK"
-    return 0
-  else
-    msg "======================================================"
-    msg "Lock file does exist. Another build process is running."
-    msg "Your changes won't appear in the home page until next build."
-    msg "Please wait in 10 minutes, or force new build by modifying"
-    msg "the file .force.build. You can put anything in that file."
-    msg " (However, if you see this message again and again,"
-    msg " there may be a problem on the server 'viettug.org'."
-    msg " Please contact the sysadmin to resolve it. THANK YOU.)"
-    msg "======================================================"
-    exit 0
-  fi
-}
-
-_lock_end() {
-  rm -f "$_F_LOCK"
-}
-
-_main() {
-  _update_myself
-  _setup
-  _update || die "Something wrong happened during updating process"
-  _build
-  _fix_news_page
-  _fetch_apache_configuration
-  _fix_perm
-  _create_www
-  _create_archive
-  _sync
-}
-
-_lock_start
-_main
-_lock_end
diff --git a/etc/apache.rewrite.conf b/etc/apache.rewrite.conf
deleted file mode 100644
index 46fb1ed..0000000
--- a/etc/apache.rewrite.conf
+++ /dev/null
@@ -1,28 +0,0 @@
-# Purpose: Provide some rewriting rules for apache configuration
-#          to use with our homepage <http://theslinux.org>
-# Author : Anh K. Huynh
-# License: GPL v2
-# Date   : 2013 June 08th
-# Note   : Some mirrors may need this sample configuration
-
-# <*apache>
-
-# Ensure you turn the engine on
-RewriteEngine on
-
-# Provide shortcuts to githubpages
-
-RedirectMatch ^/bugs/all/?$                
https://github.com/TheSLinux/gs/issues
-RedirectMatch ^/bugs/backlog/?$            
https://github.com/TheSLinux/gs/issues?labels=_backlog&page=1&state=open
-RedirectMatch ^/bugs/([0-9]+)/?$           
https://github.com/TheSLinux/gs/issues/$1
-
-# Add some shortcuts to access mailing lists
-RedirectMatch ^/lists/(user|question)s?/?$ 
http://dir.gmane.org/gmane.linux.distributions.theslinux.user
-RedirectMatch ^/lists/(devel|hacker)s?/?$  
http://dir.gmane.org/gmane.linux.distributions.theslinux.devel
-RedirectMatch ^/lists/bugs?/?$             
http://dir.gmane.org/gmane.linux.distributions.theslinux.bugs
-RedirectMatch ^/lists/security/?$          
http://dir.gmane.org/gmane.linux.distributions.theslinux.security
-
-# Mirror shorcut
-RedirectMatch ^/mirror/fpt(/.*)?$          
http://mirror-fpt-telecom.fpt.net/theslinux/$1
-
-# </apache>
diff --git a/etc/nginx.rewrite.conf b/etc/nginx.rewrite.conf
deleted file mode 100644
index c551d98..0000000
--- a/etc/nginx.rewrite.conf
+++ /dev/null
@@ -1,31 +0,0 @@
-# Purpose: Provide some rewriting rules for nginx configuration
-#          to use with our homepage <http://theslinux.org>
-# Author : Anh K. Huynh
-# License: GPL v2
-# Date   : 2013 June 08th
-
-# <*nginx>
-
-# Provide shortcuts to githubpages
-rewrite ^/bugs/all/?$                https://github.com/TheSLinux/gs/issues 
permanent;
-rewrite ^/bugs/backlog/?$            
https://github.com/TheSLinux/gs/issues?labels=_backlog&page=1&state=open 
permanent;
-rewrite ^/bugs/([0-9]+)/?$           https://github.com/TheSLinux/gs/issues/$1 
permanent;
-
-# Add some shortcuts to access mailing lists
-rewrite ^/lists/(user|question)s?/?$ 
http://dir.gmane.org/gmane.linux.distributions.theslinux.user     permanent;
-rewrite ^/lists/(devel|hacker)s?/?$  
http://dir.gmane.org/gmane.linux.distributions.theslinux.devel    permanent;
-rewrite ^/lists/bugs?/?$             
http://dir.gmane.org/gmane.linux.distributions.theslinux.bugs     permanent;
-rewrite ^/lists/security/?$          
http://dir.gmane.org/gmane.linux.distributions.theslinux.security permanent;
-
-# Adding a slash to the end of request URI
-rewrite ^([^.]*[^/])$                $1/ permanent;
-
-# Mirror shortcuts
-rewrite ^/mirror/fpt/(.*)$           
http://mirror-fpt-telecom.fpt.net/theslinux/$1 permanent;
-
-# Some restricted locations
-location /.htaccess {
-  return 444;
-}
-
-# </nginx>


hooks/post-receive
-- 
theslinux-home
--
Purpose: Store commits, feeds from other projects
Post: mailto:theslinux-phantom@xxxxxxxxxxxxx
Archive, Gmane: http://theslinux.org/lists/phantom/
Subscribe: mailto:theslinux-phantom-request@xxxxxxxxxxxxx?Subject=subscribe
Unsubscribe: mailto:theslinux-phantom-request@xxxxxxxxxxxxx?Subject=unsubscribe
Other information: http://theslinux.org/lists (vi) or 
http://theslinux.org/lists/en (en)
Support: mailto:theslinux-questions@xxxxxxxxxxxxx

Other related posts:

  • » [theslinux-phantom] theslinux-home branch master updated 27fcff7 etc.web: delete :core config. from the :master - git