From 0673036a98ff0b54d492408c543f47cfd0d06159 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Sun, 24 Aug 2014 18:06:09 +0200 Subject: [PATCH] [Project] extended checking out to support tag/branch --- bootstrap.sh | 18 ++++++++++++++---- bootstrap_https.sh | 18 ++++++++++++++---- createBundle.sh | 28 +++++++++++++++++++--------- projects.lst | 35 +++++++++++++++++------------------ pull.sh | 15 +++++++++++++-- push.sh | 16 +++++++++++++--- status.sh | 14 ++++++++++++-- 7 files changed, 102 insertions(+), 42 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index feb5d81fc..448596e44 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -9,10 +9,20 @@ while read project; do if [ "${project}" == "" ] ; then continue; fi - if [ -d "${project}" ] ; then - echo "Project ${project} already cloned." + + array=(${project//:/ }) + name="${array[0]}" + tag="${array[1]}" + + if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then + echo -e "ERROR: Invalid project: ${project}! Must have form " + exit 1 + fi + + if [ -d "${name}" ] ; then + echo "Project ${name} already cloned." else - if ! git clone "git@github.com:eitchnet/${project}.git" "${project}" ;then + if ! git clone "git@github.com:eitchnet/${name}.git" "${name}" ;then exit 1 fi echo @@ -20,4 +30,4 @@ while read project; do done < ${projectsFile} echo "Done." -exit 0 \ No newline at end of file +exit 0 diff --git a/bootstrap_https.sh b/bootstrap_https.sh index ced970948..06e7d0c06 100755 --- a/bootstrap_https.sh +++ b/bootstrap_https.sh @@ -9,10 +9,20 @@ while read project; do if [ "${project}" == "" ] ; then continue; fi - if [ -d "${project}" ] ; then - echo "Project ${project} already cloned." + + array=(${project//:/ }) + name="${array[0]}" + tag="${array[1]}" + + if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then + echo -e "ERROR: Invalid project: ${project}! Must have form " + exit 1 + fi + + if [ -d "${name}" ] ; then + echo "Project ${name} already cloned." else - if ! git clone "https://github.com/eitchnet/${project}.git" "${project}" ;then + if ! git clone "https://github.com/eitchnet/${name}.git" "${name}" ;then exit 1 fi echo @@ -20,4 +30,4 @@ while read project; do done < ${projectsFile} echo "Done." -exit 0 \ No newline at end of file +exit 0 diff --git a/createBundle.sh b/createBundle.sh index e77edaddf..cb38165ba 100755 --- a/createBundle.sh +++ b/createBundle.sh @@ -40,32 +40,42 @@ while read project; do if [ "${project}" == "" ] ; then continue; fi - if ! cd "${project}" ; then - echo "ERROR: Could not switch to directory ${project}" + + array=(${project//:/ }) + name="${array[0]}" + tag="${array[1]}" + + if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then + echo -e "ERROR: Invalid project: ${project}! Must have form " exit 1 fi - echo "INFO: Copying ${project} packages..." + if ! cd "${name}" ; then + echo "ERROR: Could not switch to directory ${name}" + exit 1 + fi + + echo "INFO: Copying ${name} packages..." if ls target/*.jar 2>/dev/null ; then if ! cp target/*.jar "${workDir}" ; then - echo "ERROR: Failed to copy package for project ${project}." + echo "ERROR: Failed to copy package for project ${name}." exit 1 fi if ! cp target/*.jar "${DIST_STROLCH}" ; then - echo "ERROR: Failed to publish package for project ${project}." + echo "ERROR: Failed to publish package for project ${name}." exit 1 fi elif ls target/*.war 2>/dev/null ; then if ! cp target/*.war "${workDir}" ; then - echo "ERROR: Failed to copy wars for project ${project}." + echo "ERROR: Failed to copy wars for project ${name}." exit 1 fi if ! cp target/*.war "${DIST_STROLCH}" ; then - echo "ERROR: Failed to publish wars for project ${project}." + echo "ERROR: Failed to publish wars for project ${name}." exit 1 fi else - echo "INFO: Project ${project} has no target, skipping." + echo "INFO: Project ${name} has no target, skipping." fi cd .. @@ -84,4 +94,4 @@ if ! mv ${projectName}-${projectVersion}.tar.gz "${DIST_STROLCH}" ; then fi echo "Done." -exit 0 \ No newline at end of file +exit 0 diff --git a/projects.lst b/projects.lst index 9755d082f..a66db9e5e 100644 --- a/projects.lst +++ b/projects.lst @@ -1,18 +1,17 @@ -ch.eitchnet.parent -ch.eitchnet.privilege -ch.eitchnet.utils -ch.eitchnet.xmlpers -li.strolch.dev -li.strolch.parent -li.strolch.bom -li.strolch.model -li.strolch.testbase -li.strolch.agent -li.strolch.service -li.strolch.rest -li.strolch.persistence.xml -li.strolch.persistence.postgresql -li.strolch.tutorialapp -li.strolch.tutorialwebapp -li.strolch.website - +ch.eitchnet.parent:1.0.0 +ch.eitchnet.privilege:master +ch.eitchnet.utils:master +ch.eitchnet.xmlpers:master +li.strolch.dev:master +li.strolch.parent:master +li.strolch.bom:master +li.strolch.model:master +li.strolch.testbase:master +li.strolch.agent:master +li.strolch.service:master +li.strolch.rest:master +li.strolch.persistence.xml:master +li.strolch.persistence.postgresql:master +li.strolch.tutorialapp:master +li.strolch.tutorialwebapp:master +li.strolch.website:master diff --git a/pull.sh b/pull.sh index 51d8f1269..54c19d92e 100755 --- a/pull.sh +++ b/pull.sh @@ -7,12 +7,23 @@ while read project; do if [ "${project}" == "" ] ; then continue; fi + + array=(${project//:/ }) + name="${array[0]}" + tag="${array[1]}" + + if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then + echo -e "ERROR: Invalid project: ${project}! Must have form " + exit 1 + fi + echo "Pulling ${project}..." - cd ${project} + cd ${name} git pull + git checkout ${tag} cd .. echo done < ${projectsFile} echo "Done." -exit 0 \ No newline at end of file +exit 0 diff --git a/push.sh b/push.sh index 25d0fa18c..82bc08827 100755 --- a/push.sh +++ b/push.sh @@ -7,12 +7,22 @@ while read project; do if [ "${project}" == "" ] ; then continue; fi - echo "Pushing ${project}..." - cd ${project} + + array=(${project//:/ }) + name="${array[0]}" + tag="${array[1]}" + + if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then + echo -e "ERROR: Invalid project: ${project}! Must have form " + exit 1 + fi + + echo "Pushing ${name}..." + cd ${name} git push cd .. echo done < ${projectsFile} echo "Done." -exit 0 \ No newline at end of file +exit 0 diff --git a/status.sh b/status.sh index 5d1e08496..7d30dd33f 100755 --- a/status.sh +++ b/status.sh @@ -7,8 +7,18 @@ while read project; do if [ "${project}" == "" ] ; then continue; fi - echo "Status of ${project}..." - cd ${project} + + array=(${project//:/ }) + name="${array[0]}" + tag="${array[1]}" + + if [ "${name}" == "" ] || [ "${tag}" == "" ] ; then + echo -e "ERROR: Invalid project: ${project}! Must have form " + exit 1 + fi + + echo "Status of ${name}..." + cd ${name} git status -s cd .. echo