From e306e9c80c384489d62dde5ca484a2b83e5f5a41 Mon Sep 17 00:00:00 2001
From: Farrukh Aftab Khan <farrukh.aftab.khan@cern.ch>
Date: Mon, 28 Sep 2015 14:37:45 +0200
Subject: [PATCH] Moving my custom scripts to dev branch, and updating README

---
 README.md              |  1 -
 pullFrontendChanges.sh | 80 -----------------------------------------
 pushFrontendChanges.sh | 82 ------------------------------------------
 3 files changed, 163 deletions(-)
 delete mode 100755 pullFrontendChanges.sh
 delete mode 100755 pushFrontendChanges.sh

diff --git a/README.md b/README.md
index 4cd1ebd0..1c611860 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,5 @@ There are two main branches that correspond to respective frontends:
 - CERN
 - FNAL
 
-Master branch only contains the basic script to push/pull changes from the repository.
 The respective frontend configurations are placed in corresponding branches.
 Each branch is further divided into directories based on pools.
diff --git a/pullFrontendChanges.sh b/pullFrontendChanges.sh
deleted file mode 100755
index d84c9ad7..00000000
--- a/pullFrontendChanges.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-
-# This script pulls the latest frontend XML from the gitlab repository
-# to local glideinWMS frontend.
-#
-# Usage:
-# First update the 'repo', 'frontend_config' and 'working_branch' as
-# intended. Make sure you have cherry-picked the commit you want to apply
-#
-# ./pullFrontendChanges.sh <pool> "<commit_message>"
-#
-# Details:
-# -------
-# Cherry pick the commit you want to apply to your branch, and run this script 
-# afterwards. It will commit the change for you too, so you just need to specify
-# a valid pool name (global, itb, tier0) and a commit message for git.
-#
-# The script does the following:
-# (1) Makes sure you have provided CLI arguments
-# (2) Pushes your cherry-pick to remote repository
-# (3) Makes sure that the repository exists
-# (4) Switches to the correct branch if needed
-# (5) Backs up the current working configuration in the same directory
-# (6) Copies the frontend configuration from git to the local node
-# (7) Reconfigures glideinWMS frontend service
-
-# Location of your repository
-repo=~/cmsgwms-frontendconfigs
-# Location of your frontend configuration
-frontend_config=/etc/gwms-frontend/frontend.xml
-# Working branch
-working_branch=cern
-# Don't forget to specify pool as an argument
-pool=$1
-
-# Checking for arguments
-if [ -z "$1" ]
-  then
-    echo "No pool provided.. exiting.."
-    exit 1
-fi
-
-if [ -z "$2" ]
-  then
-    echo "No commit message provided.. exiting.."
-
-# Making sure that the repository exists
-cd $repo
-if [ $? -eq 1 ]
-  then
-    exit 1
-fi
-
-# Making sure the branch is correct
-# If not, switch the branch
-ActiveBranch=`git branch | sed -n -e 's/^\* \(.*\)/\1/p' `
-if [ "$ActiveBranch" != "${working_branch}" ]
-  then
-    echo "Switching repository to correct branch.."
-    git checkout ${working_branch}
-fi
-sleep 1
-
-# Back up the previous configuration just in case
-echo "Backing up previous config.."
-sudo cp ${frontend_config} ${frontend_config}.backup
-
-# Copy the frontend configuration from the repository
-echo "Updating the configuration file.."
-sudo cp ${repo}/${pool}/frontend.xml ${frontend_config}
-
-# Make sure it has the correct ownership
-sudo chown -R frontend:frontend ${frontend_config}
-
-# Reconfigure glideinWMS frontend
-sudo service gwms-frontend stop
-sleep 1
-sudo service gwms-frontend reconfig
-sleep 2
-sudo service gwms-frontend start
diff --git a/pushFrontendChanges.sh b/pushFrontendChanges.sh
deleted file mode 100755
index 5e7f819d..00000000
--- a/pushFrontendChanges.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/bash
-
-# This script pushes the latest frontend XML to the gitlab repository
-#
-# Usage:
-# First update the 'repo', 'frontend_config' and 'working_branch' as
-# intended. Run the script as follows:
-#
-# ./pushFrontendChanges.sh <pool> "<commit_message>"
-#
-# Details:
-# -------
-# Make changes to your local XML file, and run this script afterwards.
-# You need to specify a valid pool name (global, itb, tier0) and a 
-# commit message for git.
-#
-# The script does the following:
-# (1) Makes sure you have provided CLI arguments
-# (2) Makes sure that the repository exists
-# (3) Switches to the correct branch if needed
-# (4) Copies the local configuration to the repository
-# (5) Commits the change and pushes to remote repository
-
-# Location of your repository
-repo=~/cmsgwms-frontendconfigs
-# Location of the frontend configuration
-frontend_config=/etc/gwms-frontend/frontend.xml
-# Working branch
-working_branch=cern
-# Don't forget to specify the pool
-pool=$1
-
-# Checking for arguments
-if [ -z "$1" ]
-  then
-    echo "No pool provided.. exiting.."
-    exit 1
-fi
-
-if [ -z "$2" ] 
-  then
-    echo "No commit message provided.. exiting.."
-    exit 1
-fi
-
-# Making sure that the repository exists
-cd $repo
-if [ $? -eq 1 ]
-  then
-    exit 1
-fi
-sleep 1
-
-# Making sure the branch is correct
-# If not, switch the branch
-ActiveBranch=`git branch | sed -n -e 's/^\* \(.*\)/\1/p' `
-if [ "$ActiveBranch" != "${working_branch}" ]
-  then
-    echo "Switching repository to correct branch.."
-    git checkout ${working_branch}
-fi
-sleep 1
-
-# Copy the frontend configuration to the repository
-echo "Updating the configuration file.."
-sudo cp ${frontend_config} ${repo}/${pool}/frontend.xml
-sleep 1
-
-# Commit local changes (if any)
-if [[ -n "$(git status --porcelain)" ]]
-  then
-    echo "Commiting the local changes.."
-    git add ${repo}/${pool}/frontend.xml
-    git commit -m "$2"
-else
-   echo "Nothing to commit.."
-   exit 0
-fi
-sleep 1
-
-echo "Pushing to remote repository.."
-git push origin ${working_branch}
-- 
GitLab